|
| ||||||||||
| Tags: table, xml |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| ||||
| ||||
| Storing Tables In Xml file.
I have Two Tables Table A Col1 Col2 TableB Col1 How can I design my XMl file for this tables? Please Help Me. |
|
#2
| ||||
| ||||
| Re: Storing Tables In Xml file.
The simplest way to design XML is by using the dataset in vb.net. 1-create the query as follows, "SELECT Col1, Col2 FROM [Table A] UNION SELECT Col1,NULL FROM [Table B]" 2-Get the result in dataset1 in asp.net then dataset1.WriteXml(path of file to save); by using this two methods you can easily create the xml file. |
|
#3
| |||
| |||
| Re: Storing Tables In Xml file.
There are lots of ways to create the xml design. One way is already mentioned in the thread. That is loading the data into DataSet and use WriteXml method to get the xml as a output. Second is to get the xml directly from the SQL Server itself using FOR XML clause. If you are using SQL Server 2005 and above you can utilize the FOR XML Path to get required xml Structure. Following is the sample using For XML Clause SELECT A.Col1, A.Col2, B.Col3 FROM TblA A INNER JOIN TblB B ON A.Col1 = B.Col1 FOR XML PATH You can also look into FOR XML AUTO, FOR XML RAW, FOR XML EXPLICIT. Which ever is applicable to your requirement you can use that. Finally, If you are just looking to get only the xml then I will recomend to go with the FOR XML Clause than going with the DataSet approach which is a Costly operation than FOR XML Clause. |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Storing Tables In Xml file." | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Storing of Application On SD Card In HTC | Plokstar | Portable Devices | 4 | 20-01-2011 10:20 PM |
| Storing VM Config files on HA File Server | Indulal | Operating Systems | 4 | 29-08-2010 06:01 AM |
| Storing photos on dvd | mohandas | Windows Software | 3 | 06-08-2009 12:53 PM |
| Storing MAC addresses in AD | boris52 | Active Directory | 4 | 27-07-2009 10:57 PM |
| Storing images in SQL database using Asp.net | Booth | Software Development | 2 | 17-01-2009 05:25 PM |