Velocity Reviews

Velocity Reviews (
-   ASP .Net (
-   -   problem de-serializing a dataset (

MattB 04-27-2004 05:47 PM

problem de-serializing a dataset
I have a dataset that originated as a string (passed from a C++ dll). I
de-serialize it, use the data, and then in some cases I will serialize it
again to pass as a session variable in my app and then de-serialize it
again. This generally works well, but I just hit a problem de-serializing
it. I have a vb class set up with commonly used code and have functions to
handle serialization and de-serialization.

Suddenly, I'm hitting the error:
The 'urn:schemas-microsoft-com:rowset:data' element is not declared. An
error occurred at , (9, 12).
with a dataset that has already successfully gone through this process. Not
sure what's going wrong or how to approach the troubleshooting.
Anyone got any ideas?

Here's that code that does the serialization/de-serialization:

Public Shared Function SerializeDS(ByVal ds As DataSet)
Dim MyXMLWriter As New System.IO.StringWriter, str As String

ds.WriteXml(MyXMLWriter, XmlWriteMode.WriteSchema)

str = MyXMLWriter.ToString()


MyXMLWriter = Nothing

Return str

End Function

Public Shared Function deSerializeDS(ByVal xml As String)

Dim ds As New DataSet

If Not IsNothing(xml) Then

Dim XMLRead As New System.IO.StringReader(xml)



XMLRead = Nothing

End If

Return ds

End Function

All times are GMT. The time now is 01:38 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.