all groups > dotnet xml > january 2007 >
You're in the

dotnet xml

group:

Saving/restoring strongly-typed DataTable to/from XML


Saving/restoring strongly-typed DataTable to/from XML timnels NO[at]SPAM gmail.com
1/31/2007 6:15:04 AM
dotnet xml: I have a strongly-typed DataTable I need to save as XML and later
reload it.

I thought that all I had to do was:

menuDataTable.WriteXml(filename,XmlWriteMode.WriteSchema);

And from another application do:

menuDataTable.ReadXml(filename);

But I keep getting... "DataTable 'ttMenuItemNS:ttMenuItem' does not
match to any DataTable in source."

Can anyone see what I am doing wrong here?

Thanks.
Re: Saving/restoring strongly-typed DataTable to/from XML Rico
2/5/2007 2:47:26 PM
Hi there

You have tp specify the schema when you read the xml document like:

menuDataTable.ReadXml(filename, XmlReadMode.ReadSchema);

Hope it helps

timnels:
[quoted text, click to view]
AddThis Social Bookmark Button