PC Review


Reply
Thread Tools Rate Thread

delete a record from datagrid

 
 
Sam
Guest
Posts: n/a
 
      31st Mar 2005
Hi,
I've filled a dataset with the results of a stored procedure.
I've then filled a datagrid with my dataset.
When I delete the row from my datagrid, I would like to commit the
deletion but I don't know how to do it. Normally I would just call
update on my dataadapter and acceptchanges on my dataset but since I've
filled the dataset with a stored procedure, I'm quite puzzled...

Someone can help ?

thx

 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      31st Mar 2005
Sam,

Acceptchanges says that the changes should be accepted as are completly
right.
This means by instance for a deleted row that it will be removed from your
dataset.

It is automaticly done by instance by an update from an original dataset.

An often made mistake is that people use a remove and tell that they delete
a datarow. There is a big difference between those two.

When this is not the case than reply

I hope this helps

Cor




 
Reply With Quote
 
julia
Guest
Posts: n/a
 
      31st Mar 2005
Hi Sam,

It's a little different in this case.

You need to create a new Dataset, with all the changed rows returned by GetChanges function.
You need to have a function that loops through all the rows of the new dataset and pass those
values to another stored procedure to update the database.

HTH

Mona


"Sam" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> Hi,
> I've filled a dataset with the results of a stored procedure.
> I've then filled a datagrid with my dataset.
> When I delete the row from my datagrid, I would like to commit the
> deletion but I don't know how to do it. Normally I would just call
> update on my dataadapter and acceptchanges on my dataset but since I've
> filled the dataset with a stored procedure, I'm quite puzzled...
>
> Someone can help ?
>
> thx
>

 
Reply With Quote
 
Sam
Guest
Posts: n/a
 
      31st Mar 2005
Right. Is GetChanges going to return deleted rows as well ? In that
case I could do that indeed. cheers !

 
Reply With Quote
 
Sam
Guest
Posts: n/a
 
      31st Mar 2005
actually I have another problem. I would like to call that new stored
procedure (which will take care of the deletion) as soon as the user
has deleted a row from the datagrid. So in which event should I put my
call to the stored procedure ? (I can't find a onDelete-like method of
the datagrid...)
thx

 
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
Prevent Subform from saving record or delete record when moving tomain form RussCRM Microsoft Access Form Coding 0 3rd Apr 2008 07:26 PM
datagrid, delete record from table schapopa Microsoft VB .NET 2 28th May 2006 07:17 PM
Upon delete record, conditional delete record from another table =?Utf-8?B?UmljaDEyMzQ=?= Microsoft Access 6 14th Oct 2005 02:48 PM
IE refresh button delete datagrid record. =?Utf-8?B?U3ltcGhvbnk=?= Microsoft Dot NET 0 23rd Apr 2005 01:39 AM
Cannot delete a record after adding in a DataGrid HS1 Microsoft VB .NET 0 7th Jan 2005 11:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:16 AM.