If there is an easier way than the Dataset object to process the database, please let me know.
Any help would be most appreciated.
Thanks,
Bruce
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sam HobbsRank #107 · 20.5K reputationPosted Dec 3, 2009, 9:31 PM EST
I admit that the XmlSerializer class and related classes are very frustrating to understand. I really think the documentation is very inadequate compared to what it could be. Once we understand a few basics it can be very productive. The following code works with the sample data you provided.
First, I created a separate file for the data definition.
Then the code is:
Amit ChoudharyRank #145 · 15.8K reputationPosted Dec 2, 2009, 7:04 PM EST
Using dataset to manipulate the data from an xml file is itself and easiest way other wise you have to manipulate that xml tags using Your programming logic that itself have its complexity .... so just try Dataset it has lots of functions and properties you can use to manipulate its Data....
Sam HobbsRank #107 · 20.5K reputationPosted Dec 2, 2009, 8:09 PM EST
The following console program is a skeleton of what you would need. This sample will only read in the names of each DatabaseItem. You probably can use the XmlSerializer class to read in all of the data but as I said I don't know the format of all your data.
Note that the InnerException member of an exception can be null and you need to check for null there but I forgot to modify the sample code for that. Otherwise you can use this code as-is to try out use of the XmlSerializer class. It is one way that can make things easy.
Jayhawks Rock9 reputationPosted Dec 3, 2009, 1:00 PM EST
Thanks again,
Bruce