PC Review


Reply
Thread Tools Rate Thread

Changing a dataset table rows datasetstate

 
 
-=JLK=-
Guest
Posts: n/a
 
      3rd Aug 2004
All,

Is there a way to add a new row to a dataset but make it think it is
changed data and should perform an "Update" rather than insert when the
update() method is called?

Thanks,

JamesK


 
Reply With Quote
 
 
 
 
Tim Ellison
Guest
Posts: n/a
 
      3rd Aug 2004
Try adding the row, then calling AcceptChanges() on the row, then modifying
one of the columns.

--
Regards,

Tim Ellison
"-=JLK=-" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> All,
>
> Is there a way to add a new row to a dataset but make it think it is
> changed data and should perform an "Update" rather than insert when the
> update() method is called?
>
> Thanks,
>
> JamesK
>
>



 
Reply With Quote
 
-=JLK=-
Guest
Posts: n/a
 
      3rd Aug 2004
My concern there would be the type of update statement generated. Would it
try to include as "original" column data the column as it looked before the
second modification? If the update statement includes only the Primary Key
it would be OK but I thought it tried to include all changed columns by
default?

Thanks,

James K.

"Tim Ellison" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Try adding the row, then calling AcceptChanges() on the row, then

modifying
> one of the columns.
>
> --
> Regards,
>
> Tim Ellison
> "-=JLK=-" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > All,
> >
> > Is there a way to add a new row to a dataset but make it think it is
> > changed data and should perform an "Update" rather than insert when the
> > update() method is called?
> >
> > Thanks,
> >
> > JamesK
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display rows from one table not in another in a dataset Sam Microsoft VB .NET 1 16th May 2008 04:38 AM
removing rows from a table in a dataset =?Utf-8?B?YW1iZXI=?= Microsoft Dot NET 0 27th Sep 2005 08:21 PM
Disallowing new table rows in a dataset Cat Microsoft C# .NET 2 3rd Jun 2004 11:27 AM
HOWTO: Iterate thru dataset rows changing field values Dan Sikorsky Microsoft VB .NET 7 14th Feb 2004 09:58 PM
Index out of range error when deleting rows in dataset table with relationships defined between fields in the same table JerryK Microsoft ADO .NET 0 19th Sep 2003 06:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:22 PM.