onedunpark
IS-IT--Management
Hi,
I have a dataset where some of the values are "". When writing the dataset to XML using the following approach, it only writes those columns that have values. I really need all columns to be written to the file regardless of whether or not a value exists.
Dim objAdapter As SqlClient.SqlDataAdapter = New
SqlClient.SqlDataAdapter(SQL, GetDBProvider(DBName))
Dim objDataTable As New System.Data.DataSet
objAdapter.Fill(objDataTable)
objAdapter.Dispose() : objAdapter = Nothing
objDataTable.WriteXml(XMLPath, XmlWriteMode.IgnoreSchema)
I'm sure this is really easy but I'm stumped and having looked at code all over the place am starting to confuse myself. I'm guessing I have to iterate through the dataset and extract/write each value in turn, but looking at the other code examples I'm at a bit of loss as to how
Any and all replies appreciated
Steven
I have a dataset where some of the values are "". When writing the dataset to XML using the following approach, it only writes those columns that have values. I really need all columns to be written to the file regardless of whether or not a value exists.
Dim objAdapter As SqlClient.SqlDataAdapter = New
SqlClient.SqlDataAdapter(SQL, GetDBProvider(DBName))
Dim objDataTable As New System.Data.DataSet
objAdapter.Fill(objDataTable)
objAdapter.Dispose() : objAdapter = Nothing
objDataTable.WriteXml(XMLPath, XmlWriteMode.IgnoreSchema)
I'm sure this is really easy but I'm stumped and having looked at code all over the place am starting to confuse myself. I'm guessing I have to iterate through the dataset and extract/write each value in turn, but looking at the other code examples I'm at a bit of loss as to how
Any and all replies appreciated
Steven