W
WStoreyII
i have used the following code(which is straight from the msdn) to try this
: how ever this and anyother method that i have tried only give me a
An unhandled exception of type 'System.InvalidCastException' occurred in
system.data.dll
Additional information: Specified cast is not valid.
does anyone have any ideas on what is going wrong?
WStoreyII
Thanks again
Private Sub WriteSchemaWithXmlTextWriter(thisDataSet As DataSet)
' Set the file path and name. Modify this for your purposes.
Dim filename As String = "mySchema.xml"
' Create a FileStream object with the file path and name.
Dim myFileStream As New System.IO.FileStream _
(filename, System.IO.FileMode.Create)
' Create a new XmlTextWriter object with the FileStream.
Dim MyXmlTextWriter As New System.Xml.XmlTextWriter _
(myFileStream, System.Text.Encoding.Unicode)
' Write the schema into the DataSet and close the reader.
thisDataSet.WriteXmlSchema(MyXmlTextWriter)
MyXmlTextWriter.Close()
: how ever this and anyother method that i have tried only give me a
An unhandled exception of type 'System.InvalidCastException' occurred in
system.data.dll
Additional information: Specified cast is not valid.
does anyone have any ideas on what is going wrong?
WStoreyII
Thanks again
Private Sub WriteSchemaWithXmlTextWriter(thisDataSet As DataSet)
' Set the file path and name. Modify this for your purposes.
Dim filename As String = "mySchema.xml"
' Create a FileStream object with the file path and name.
Dim myFileStream As New System.IO.FileStream _
(filename, System.IO.FileMode.Create)
' Create a new XmlTextWriter object with the FileStream.
Dim MyXmlTextWriter As New System.Xml.XmlTextWriter _
(myFileStream, System.Text.Encoding.Unicode)
' Write the schema into the DataSet and close the reader.
thisDataSet.WriteXmlSchema(MyXmlTextWriter)
MyXmlTextWriter.Close()