How to storage the records of DataSet to MSSQL table?
-
Hi, The records of the DataSet were loaded from Web Service. I wanna save the records to MS SQL Server table. How can I do? I get a idea: Save the data to xml documents by WriteXml() method, and load the data from xml into SQL Server table. If I do like this , how can I load the xml's records into table? Thanks!
-
Hi, The records of the DataSet were loaded from Web Service. I wanna save the records to MS SQL Server table. How can I do? I get a idea: Save the data to xml documents by WriteXml() method, and load the data from xml into SQL Server table. If I do like this , how can I load the xml's records into table? Thanks!
Are you looking for this using System.Data.SqlClient; public DataTable ReturnDataTbl(string XmlFile) { DataSet dset = new DataSet(); FileStream fstr = new FileStream(XmlFile, FileMode.Open, FileAccess.Read); dset.readXml(fstr); DataTable dtbl = dset.Tables[0]; fstr.Close(); dset.Dispose(); return dtbl; } Live Life King Size Alomgir Miah