PC Review


Reply
Thread Tools Rate Thread

Controlling which Added DataRows get added on a call to Update

 
 
Greg
Guest
Posts: n/a
 
      21st Oct 2003
DataAdapter.Update takes as a param a DataTable. Our DataTable has 4 Added
DataRows. I only want to truly do an insert on the first Added DataRow,
then, come back, do some massaging, then do an insert on the 2nd Added
DataRow, etc. How can I control this?




 
Reply With Quote
 
 
 
 
Rajesh Patel
Guest
Posts: n/a
 
      21st Oct 2003
check dataadapter events.

"Greg" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> DataAdapter.Update takes as a param a DataTable. Our DataTable has 4

Added
> DataRows. I only want to truly do an insert on the first Added DataRow,
> then, come back, do some massaging, then do an insert on the 2nd Added
> DataRow, etc. How can I control this?
>
>
>
>



 
Reply With Quote
 
Greg
Guest
Posts: n/a
 
      21st Oct 2003
Yeah, I thought of that, like OnRowUpdating. Was hoping there was a simple
'try this' out there without having to handle the event.


"Rajesh Patel" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> check dataadapter events.
>
> "Greg" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > DataAdapter.Update takes as a param a DataTable. Our DataTable has 4

> Added
> > DataRows. I only want to truly do an insert on the first Added DataRow,
> > then, come back, do some massaging, then do an insert on the 2nd Added
> > DataRow, etc. How can I control this?
> >
> >
> >
> >

>
>



 
Reply With Quote
 
Greg
Guest
Posts: n/a
 
      21st Oct 2003
2nd issue with handling the event is our data tier logic is very generic.
It simply takes a datatable. I do not want to introduce code in the data
tier logic that looks at a particular datatable by name and handles the
update accordingly.


"Rajesh Patel" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> check dataadapter events.
>
> "Greg" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > DataAdapter.Update takes as a param a DataTable. Our DataTable has 4

> Added
> > DataRows. I only want to truly do an insert on the first Added DataRow,
> > then, come back, do some massaging, then do an insert on the 2nd Added
> > DataRow, etc. How can I control this?
> >
> >
> >
> >

>
>



 
Reply With Quote
 
David Sceppa
Guest
Posts: n/a
 
      21st Oct 2003
Greg,

You could create an array of DataRow objects, ordered based
on how you want to submit the new rows, and use that array when
calling DataAdapter.Update. If the order could be based on the
sort order of a column (or set of columns), you could create the
array of DataRow objects by calling DataTable.Select, supplying
the appropriate criteria and sort order.

I hope this information proves helpful.

David Sceppa
Microsoft
This posting is provided "AS IS" with no warranties,
and confers no rights. You assume all risk for your use.
© 2003 Microsoft Corporation. All rights reserved.

 
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
Outlook 2003 Minor annoyance with added 'extra line breaks' added. Keith Microsoft Outlook Discussion 2 1st Jun 2009 06:57 PM
Will a row added to a DataView automatically be added to the underlying DataTable? Ronald S. Cook Microsoft VB .NET 1 7th Jul 2007 06:44 PM
Added table to database, added to form, now cannot update =?Utf-8?B?ZGhvZWZ0?= Microsoft Access Forms 1 22nd Mar 2006 09:54 PM
events added to public folder calendar only show in user who added to it???? matthew hall Microsoft Outlook Calendar 0 21st Jan 2005 03:21 PM
how come user control added to page doesn't get added to codebehind file? Bennett Haselton Microsoft ASP .NET 1 8th Nov 2004 09:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:05 AM.