sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
timnels@gmail.com's Avatar

Saving/restoring strongly-typed DataTable to/from XML


Question posted by: timnels@gmail.com (Guest) on January 31st, 2007 02:25 PM
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.Write Schema);

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.

1 Answer Posted
Rico's Avatar
Guest - n/a Posts
#2: Re: Saving/restoring strongly-typed DataTable to/from XML

Hi there

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

menuDataTable.ReadXml(filename, XmlReadMode.ReadSchema);

Hope it helps

timnels:
Quote:
Originally Posted by
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.Write Schema);
Quote:
Originally Posted by
>
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.

 
Not the answer you were looking for? Post your question . . .
197,004 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 197,004 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top Community Contributors