I export Data from ASP.Net/SQL to xml successfully.
Below is the code
Dim ds As New DataSet()
Try
Dim con As New SqlConnection("server=BAK;initial catalog=Test;uid=sa;pwd=sa")
con.Open()
Dim da As New SqlDataAdapter("select Emp_No,Emp_Name,Emp_GSM1 from Employee", con)
da.Fill(ds, "Employee")
Catch
'Label1.Text = "Error while connecting to a database"
End Try
Dim doc As New XmlDataDocument(ds)
Xml1.Document = doc
doc.Save("D:\Employee.xml")
But what i'm facing the problem, when Emp_GSM1 is null value then its not showing in XML file.
Example
-
How to export xml with even null value.
Thanks
Basit.
Manas MohapatraPosted Dec 20, 2015, 8:04 AM
Basit KhanPosted Dec 20, 2015, 11:54 PM