Dim vacid As Integer = Convert.ToInt32(DirectCast(GridView1.Rows(e.RowIndex).FindControl("txtVacid"), TextBox).Text) Dim myCommand As New SqlCommand Dim myConnection = New SqlConnection(ConfigurationSettings.AppSettings("connectionString")) Dim update As String Dim strsql As String myCommand.Connection = myConnection 'vacid = CInt(GridView1.Rows(GridView1.SelectedRow.RowIndex).Cells(0).Text) update = "Delete from Pat_Vaccine_Details where vaccine_id='" & vacid & "'" myCommand = New SqlCommand(update, myConnection) myConnection.Open() myCommand.ExecuteNonQuery() myCommand.Connection.Close() BindGrid() End Sub
vacid
null
Nothing
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)