Protected sub gridview1rowupdating

Which is better to do, to add, edit and delete on the gridview or I should select one and put the data on the textboxes and their is the time I can edit some data? the Primary key is editable, how can I set the Unique_C (Primary Key) to be uneditable? after I clicked the Update on the gridview, the table doesn't appear anymore. Hi sir :) I made a sample of the code you gave to me :) and it's right :) I can update the record.

The server page is publicly accessible but can be disabled in the control panel if so desired.

Open() Using da As Sql Data Adapter = New Sql Data Adapter(comm) dt = New Data Table("tbl") da. Open() Using da As New Sql Data Adapter(comm) dt = New Data Table("tbl") da.

ID" Dim s Constr As String = Configuration Manager. Connection String Using conn As Sql Connection = New Sql Connection(s Constr) Using comm As Sql Command = New Sql Command(SQL, conn) conn. Data Bind() End Sub protected void Grid View1_Row Data Bound(object sender, Grid View Row Event Args e) protected void Grid View1_Row Updating(object sender, Grid View Update Event Args e) protected void Grid View1_Row Editing(object sender, Grid View Edit Event Args e) protected void Grid View1_Row Canceling Edit(object sender, Grid View Cancel Edit Event Args e) 0 Then Dim cbo Brand As Drop Down List = Direct Cast(e. Find Control("cbo Brand"), Drop Down List) Dim dt As Data Table Dim SQL As [String] = "SELECT * FROM Brand" Dim s Constr As String = Configuration Manager. Connection String Using conn As New Sql Connection(s Constr) Using comm As New Sql Command(SQL, conn) conn.

Edit Index = -1 Bind Grid View() End Using End Sub Protected Sub Grid View1_Row Canceling Edit(sender As Object, e As System.

Edit Index = -1 Bind Grid View() End Sub Note: Grid View1.