how to generate a xml file for a table in sql server using Linq to sql help me--------
hi give me replay plz
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.
Jaganathan BantheswaranPosted Mar 18, 2011, 8:52 AM
Try this easy way.
SqlDataAdapter cmd = new SqlDataAdapter("select * from " + tab, con);
DataSet ds = new DataSet();
cmd.Fill(ds,tab);
ds.WriteXml("c:\\DB\\" + tab +".xml", XmlWriteMode.WriteSchema);