You can refer this document:
Main Topics
Browse All TopicsI have an asp.net web page that my update command does not seem to be working properly and I cannot figure out what. Any help would be appreciated. If there is anything else you need to know I will be happy to answer.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: gdupadhyayPosted on 2008-07-07 at 14:29:43ID: 21948846
Please modify the following line in your code:
<asp:gridview id="grdJzTrucks" runat="server" autogeneratecolumns="FalseAfter this: Add this to your code.
Protected Overridable Sub UpdateCommand(ByVal sender As Object, ByVal GridViewUp dateEventA rgs)
e As System.Web.UI.WebControls.
Dim selectRow As GridViewRow
Dim _SQLStr As String
selectRow = GridView1.Rows(e.RowIndex)
If createSQLquery
/*
if you want to generate an ad-hoc query, place your SQL string gen code here and continue on, otherwise replace the SQL stuff with your code and cancel when finished. Since you've canceled the edit mode _request_, it returns to select mode.
*/
_SQLStr = "INSERT INTO yadda... yadda... ;" nd = _SQLStr
Please let me know if you have any questionGanesh Dutt UpadhyaySqlDataSource1.UpdateComma
Else
' otherwise, do your code and cancel the edit request.
domycode()
e.Cancel = True
End If