SqlConnection Con = new SqlConnection("server=.;uid=.;Pwd=.;database=.");
SqlDataAdapter da = new SqlDataAdapter("Select top 10 * from SoftLawrence", Con);
DataSet DS = new DataSet();
da.Fill(DS);
DS.WriteXml("F:\\SoftLawrence\\Sample.XML");
DS.WriteXmlSchema("F:\\SoftLawrence\\Test.XSD");
//To convert the Xml file to Dataset
DataSet dsVat = new DataSet();
string appPath = GetExecutingPath();
dsVat.ReadXml(appPath + "Sample.xml");
return dsVat;
SqlDataAdapter da = new SqlDataAdapter("Select top 10 * from SoftLawrence", Con);
DataSet DS = new DataSet();
da.Fill(DS);
DS.WriteXml("F:\\SoftLawrence\\Sample.XML");
DS.WriteXmlSchema("F:\\SoftLawrence\\Test.XSD");
//To convert the Xml file to Dataset
DataSet dsVat = new DataSet();
string appPath = GetExecutingPath();
dsVat.ReadXml(appPath + "Sample.xml");
return dsVat;