473,396 Members | 1,970 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

datagrid editing

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!
Nov 17 '05 #1
3 1713
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" <mr*@telcoelectronics.co.uk> wrote in message
news:O$**************@TK2MSFTNGP11.phx.gbl...
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!

Nov 17 '05 #2
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!
Nov 17 '05 #3
Correct..
"Mike P" <mr*@telcoelectronics.co.uk> wrote in message
news:uN**************@TK2MSFTNGP12.phx.gbl...
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!

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Junkguy | last post by:
I need some help programmatically causing a row in a DataGrid to "flush" its contents to its bound data (in Visual Studio 6 using Windows Forms with C#). My issue is I want to send an update to...
3
by: Bill C. | last post by:
Hello, I know this has been discussed a lot already because I've been searching around for information the last few weeks. I'm trying to implement a DataGridComboBoxColumn class. I've found...
3
by: Zürcher See | last post by:
Someone has implemented a Datagrid Button for the Windows.Form?
0
by: Paolo Tardivel via DotNetMonster.com | last post by:
I have a databound datagrid containing template columns which allow editing of the values contained in the datagrid through the use of text boxes. One of the fields in the datagrid displays the...
3
by: Islamegy | last post by:
When i press btn_save all changed rows in my grid get saved except the last editing row... I want my btn_Save to end editing in the datagrid.. so if user didn't press "enter" after editing last...
9
by: tshad | last post by:
Is there a way to use your own image in place of the automatic one that ASP uses when doing editing in your DataGrid pages? We already have a style of button we are using and would like to be...
2
by: Sharon | last post by:
I want put into my DataGrid different control types in the same column. For example: Column 1, row 0 ==> TextBox Column 1, row 2 ==> CheckBox Column 1, row 2 ==> ComboBox etc... As I see, I...
8
by: =?Utf-8?B?bWlrZWc=?= | last post by:
Hi, I am building a small Help Desk application for my company and need to be able to edit "open" help desk issues. I use a simple datagrid to display each issue (6 per page) , with an Edit...
0
by: hanusoft | last post by:
This is an example of editing in DataGrid and Default Paging http://www.hanusoftware.com Html Design Code : - <asp:DataGrid id="DataGrid1" DataKeyField="id" runat="server" Height="224px"...
2
by: jock1up | last post by:
I am working with editing within a DataGrid control cell and am confused about which events occur after the editing is completed. I see that 5 events can occur total, including the ones below and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.