Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleted DataRows
Message
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00700294
Message ID:
00700327
Views:
8
Write it like:
StringWriter cXML = new StringWriter();
ds.WriteXml(cXML,XmlWriteMode.DiffGram);
cReturnString = cXML.ToString();
>OK, Cathi ... thanks. I tried looking at this, but still can't find what I need. How do I use WriteXML to get an XML string? I don't want it to write to a file, I just need it to do similarly to what I was doing with GetXML(). IOW, something like:
>
>string MyXML = ds.WriteXML( ... what parms? ...);
>
>~~Bonnie
>
>
>>Calling GetXml yields the same results as calling WriteXml and
>>specifying an XmlWriteMode of IgnoreSchema. This means that only the
>>current values of the data are provided. To get more complete
>>information, including deleted rows, you need to specify an
>>XmlWriteMode of DiffGram. This is not possible when calling
>>GetXml--only when calling WriteXml.
>>
>>
>>>Hey gang,
>>>
>>>Here's another stumper for y'all:
>>>
>>>I've deleted a row in a table. Looking at ds.Tables[0].Rows[0].RowState, I can see that the row is marked Deleted. OK, then I get the changed rows with ds2 = ds.GetChanges() and can see that ds2 *does* have a table which in fact *does* contain one row and that ds2.Table[0].Rows[0].RowState is marked as Deleted.
>>>
>>>OK so far, but now try getting that into an XML string. MyXML = ds2.GetXML(). Should work, right? It doesn't. MyXML is < MyDataSet / > ... IOW, it's empty.
>>>
>>>How the heck can I get my deleted records into the XML string??? Or is this a bug?? Any ideas??
>>>
>>>TIA,
>>>~~Bonnie
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Reply
Map
View

Click here to load this message in the networking platform