How to show messagebox in onrowupdating
Referential integrity constraints would make the code for an example that actually deletes rows from the Customer table more complex.
For any other name, the delete operation proceeds and the row is deleted. Rows are deleted from the Customer Address table instead of the Customer table in order to keep the example simple. See the "The Command: Executing SQL Statements" section of Chapter 4 for more on using commands. Row Updated, Address Of On Row Updated ' Add a new data row and call Update method ' of data adapter Dim cust Row As Data Row = cust DS. New Row() cust Row("Customer ID") = "NEWCO" cust Row("Company Name") = "New Company" cust DS. Row Updated, Address Of On Row Updated ' Close the connection Sql Connection1. Dispose() End Sub objects to select, update, and delete data from the table. -Frinny Notice how I have added a Template Field to the Columns section of the Grid View? Even if the end user is displayed the Message Box it's not a good idea. Row Data Bind Event to set the background colour instead of doing this in your Fill Grid method.