Try Dim I As Integer For I = 0 To GridView1.SelectedRowsCount() - 1 If (GridView1.GetSelectedRows()(I) >= 0) Then Dim strID As String = GridView1.GetRowCellValue(I, "ID") Dim strUpdate As String = "UPDATE records SET payment_order= @payment_order where ID = @ID" cmd.CommandType = CommandType.Text cmd.CommandText = strUpdate.ToString() cmd.Parameters.Clear() cmd.Parameters.AddWithValue("@payment_order", rfnd_id_lbl.Text) cmd.Parameters.AddWithValue("@ID", strID) cmd.Connection = con con.Open() cmd.ExecuteNonQuery() End If Next Catch ex As SqlException Dim errorMsg As String = "Error in Update" errorMsg += ex.Message Throw New Exception(errorMsg) Finally con.Close() End Try
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)