Solved

what is the best way to read a dataset.getXml() string into another dataset object?

Posted on 2006-11-07
2
373 Views
Last Modified: 2012-06-22
what is the best way to read a dataset.getXml() string into another dataset object?
0
Comment
Question by:joshuadavidlee
2 Comments
 
LVL 5

Assisted Solution

by:prajapati84
prajapati84 earned 100 total points
ID: 17896006
You can use for serialization and deseralization. Actually first write urDataset to a stringwriter and then read this stringwriter using stringreader and then read this string reader using Dataset.ReadXml method. So, finally you can readxml into other dataset.

' Serialization
Dim sw As New System.IO.StringWriter
ds1.WriteXml(sw)
Dim mystring As String = sw.tostring

'Deserialization
Dim sr As New System.IO.StringReader(mystring)
Dim ds2 As New DataSet
ds2.ReadXml(sr)

Regards,
Mukesh
0
 
LVL 3

Accepted Solution

by:
rugu_16 earned 400 total points
ID: 17899853
this should work just fine

            string s = ds.GetXml();
            System.IO.StringReader r = new System.IO.StringReader(s);
            dataset.ReadXml(r);

helpful article

http://www.thescripts.com/forum/thread383280.html



0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is an explanation of a simple data model to help parse a JSON feed
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now