-
Deleted DataRows
I'll try another question, but I must admit that I have not received one
answer to the questions I've posted here. I get better responses to my
questions on the UT (Universal Thread www.universalthread.com.) ... but I
figure you guys have gotta start answering one of these days, so here goes
.....
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
-
Re: Deleted DataRows
A quote from an MSDN article titled "Writing a DataSet as XML Data".
"When a DataSet is written as XML data, the rows in the DataSet are written
in their current versions. However, the DataSet can also be written as a
DiffGram so that both the current and the original values of the rows will
be included."
Note that a deleted row has NO current value, but does have an original value.
I don't believe this is a bug.
I'm not sure what you're trying to do, but you may want to write the XML
as a diffgram using the overload:
public void WriteXml(string, XmlWriteMode);
XmlWriteMode would specify diffgram.
Hope that helps,
Ian Drake
"Bonnie Berent" <bonnieb@profitware-online.com> wrote:
>I'll try another question, but I must admit that I have not received one
>answer to the questions I've posted here. I get better responses to my
>questions on the UT (Universal Thread www.universalthread.com.) ... but
I
>figure you guys have gotta start answering one of these days, so here goes
>.....
>
>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
>
>
-
Re: Deleted DataRows
I've seen some of your questions, and completely understand your frustrations.
I'm just starting to stick my head into ADO.NET and XML, and I think all
of us are kind of in the same boat. We're all learning by banging our heads
against the wall.
I have not seen any message boards anywhere that deal strictly with ADO.NET
but from what I've seen, I can give you a couple of suggestions to try where
there are some people with bigger brains than I have that actually poke their
heads into the boards and usually give good responses.
I know for a fact that the VB development team from Microsoft routinely looks
at the message boards on the VB.NET side here and they are making a pretty
diligent effort to try to answer questions that nobody else knows the answer
to. Even though it's a C# question, you could always try posting your question
there. You'll have a pretty good chance that someone from Microsoft will
see it and give you an answer, it just might be in VB(but not hard to translate
into C#).
The other place where I've seen some pretty good answers to these questions
is on the GotDotNet message board. I've seen some pretty advanced answers
to ADO.NET in C# there. It's also run by Microsoft, and the development team
keeps up with the questions and will also post answers to things that nobody
else knows the answer to.
I'm not saying you won't see an answer to your question here, though. As
we all gain experience and knowledge, more of us will be able to address
some of these questions.
-
Re: Deleted DataRows
What you want is a diffgram. The XML that is returned from a dataset is the
"current" state.
"Bonnie Berent" <bonnieb@profitware-online.com> wrote in message
news:3d822819@10.1.10.29...
> I'll try another question, but I must admit that I have not received one
> answer to the questions I've posted here. I get better responses to my
> questions on the UT (Universal Thread www.universalthread.com.) ... but I
> figure you guys have gotta start answering one of these days, so here goes
> ....
>
> 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
>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks