Expand|Select|Wrap|Line Numbers
- Sub CustomersGridView_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
- Dim row As GridViewRow = GridView1.SelectedRow
- Dim str As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & Server.MapPath("database\db1.mdb")
- Dim conn As New OleDbConnection(str)
- If row.Cells(2).Text = "" Then
- Dim mySelectQuery As String = "SELECT State, FileID FROM Table3"
- Dim myUpdateQuery As String = "Update Table3 Set State='6' where FileID=" & "'" & row.Cells(1).Text & "'" & ""
- Dim myConnection As New OleDbConnection(str)
- Dim myCommand As New OleDbCommand(mySelectQuery, myConnection)
- Dim myCommand2 As New OleDbCommand(myUpdateQuery, myConnection)
- Dim retvalue As Integer
- myConnection.Open()
- myCommand2.ExecuteNonQuery()
- Console.WriteLine(retvalue)
- Dim myReader As OleDbDataReader
- myReader = myCommand.ExecuteReader()
- While myReader.Read <> 0
- Label1.Text = ("Successfully Approve")
- End While
- myReader.Close()
- myConnection.Close()
- End If