Dataset related question?
-
Say suppose I have populated two tables data in dataset called one “Customer” and other “Order”. How could I save the customer table detail to any xml file from my Dataset? Please give me the code by which I can save only one table detail to xml file if there is 10 tables detail in my dataset. tbhattacharjee
-
Say suppose I have populated two tables data in dataset called one “Customer” and other “Order”. How could I save the customer table detail to any xml file from my Dataset? Please give me the code by which I can save only one table detail to xml file if there is 10 tables detail in my dataset. tbhattacharjee
'Suppose in the dataset ds you have three tables 'Customer, Order and Supplier. If you want to save 'the Customer table. Below is the code
'Duplicate the table and add it to a DataSet Dim datatb As DataTable = ds.Tables("Customer") Dim datatbTmp As DataTable = datatb.Copy() Dim dsTmp As DataSet = New DataSet() dsTmp.Tables.Add(datatbTmp) 'Save data to xml file and schema file dsTmp.WriteXml(Server.MapPath("Customers.xml"), XmlWriteMode.IgnoreSchema) dsTmp.WriteXmlSchema(Server.MapPath("Customers.xsd"))