CREATE TABLE dbo.Txml
(
brRacuna int NULL,
korisnickoime varchar(50) NULL,
xmldata xml NULL
)
I need to write xml file into column xmldata and aslo read data from this column using linq query
I need realy help thanks in advance
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Guest UserPosted Aug 1, 2014, 5:08 AM
miroslav nikolicPosted Aug 1, 2014, 5:07 AM
DataClasses1DataContext Pro = new DataClasses1DataContext();
XElement xlinq = new XElement("ProizvodUkorpi",
from p in Pro.ProizvodUkorpis
where p.korisnickoime == korime
select new XElement("proizvod",
new XElement("naziv", p.naziv),
new XElement("kolicina", p.kolicina),
new XElement("cena", p.cena),
new XElement("iznos", p.iznos)
)
);
Txml nov = new Txml();
nov.xmldata = xlinq;
nov.korisnickoime = korime;
Pro.Txmls.InsertOnSubmit(nov);
Pro.SubmitChanges();
One more thanks on your time and help
Guest UserPosted Jul 31, 2014, 7:16 AM
var xmlFile = System.IO.ReadFile("xml.dat")
now store this xmlFile into sqlserver column
# While you're reading it back you can use it in same fashion , e.g.,
var sqlOutput = db