Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > datagrid editing

Reply
Thread Tools

datagrid editing

 
 
Mike P
Guest
Posts: n/a
 
      10-15-2003
I have a datagrid with a 'Delete' column that the user can click on to
delete a row in the datagrid. I thought that I would need to have some
kind of error handling in case somebody goes into the database table
that the datagrid uses and deletes a record while the user is still
viewing the record in their datagrid, since if they then press 'Delete'
on a record that has since been deleted from the table, a concurrency
error should occur. But after trying this, no error is raised at all,
on pressing 'Delete' the record is simply removed from the datagrid.
Does anybody know why this happens? And do I therefore not need to
provide error handling for this?


Cheers,

Mike



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
martin
Guest
Posts: n/a
 
      10-15-2003
most likely you have removed the record from the datagrid or the underlaying
dataset and then not bound back to the database table.

you need to delete from the database table and the rebind the datagrid.

if you are deleting from the database using a command such as

"Delete from mytable where record=deletevalue"

and this record does not exist in the db then you will not get an error. It
is best to check the rowcount property (usually in the db) to actually
ensure that 1 row was deleted.
although you may think not deleting a row is an error, the database does
not.

hope I have understood you correctly.

cheers

martin

"Mike P" <(E-Mail Removed)> wrote in message
news:O$(E-Mail Removed)...
> I have a datagrid with a 'Delete' column that the user can click on to
> delete a row in the datagrid. I thought that I would need to have some
> kind of error handling in case somebody goes into the database table
> that the datagrid uses and deletes a record while the user is still
> viewing the record in their datagrid, since if they then press 'Delete'
> on a record that has since been deleted from the table, a concurrency
> error should occur. But after trying this, no error is raised at all,
> on pressing 'Delete' the record is simply removed from the datagrid.
> Does anybody know why this happens? And do I therefore not need to
> provide error handling for this?
>
>
> Cheers,
>
> Mike
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
 
 
 
Mike P
Guest
Posts: n/a
 
      10-15-2003
Martin,

I just wondered if I should be getting an error even though I wasn't.
I'm using direct SQL 'DELETE * FROM Table WHERE ID = ", so if this isn't
actually meant to generate an error, it is probably OK to leave my code
as it is...there's no need to inform the user that the record was
deleted by somebody else, as long as it is deleted.


Thanks,

Mike


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
Alex
Guest
Posts: n/a
 
      10-15-2003
Correct..


"Mike P" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Martin,
>
> I just wondered if I should be getting an error even though I wasn't.
> I'm using direct SQL 'DELETE * FROM Table WHERE ID = ", so if this isn't
> actually meant to generate an error, it is probably OK to leave my code
> as it is...there's no need to inform the user that the record was
> deleted by somebody else, as long as it is deleted.
>
>
> Thanks,
>
> Mike
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Are you looking for high quality photo editing and video editing? gwanglu@gmail.com C Programming 0 07-19-2006 12:32 PM
Disable editing a particaular column in a datagrid =?Utf-8?B?QmFza2FyYW4uSy5S?= ASP .Net 1 09-25-2004 05:37 AM
Editing a datagrid nested within another datagrid uk00121 ASP .Net Datagrid Control 2 04-19-2004 02:17 PM
Disabling a field when editing an existing record in a Datagrid Mark Perona ASP .Net 2 08-12-2003 07:24 PM
How to use popup window editing datagrid items? Joseph Yang ASP .Net 1 08-09-2003 01:42 AM



Advertisments