This Code is behind a button which loads my Datagrid, from an Access Database. Now I would like to have button which Delete's the Highlight rows in my Datagrid from my Database.
Can anyone please help me????
Private Sub Button3_Click
Dim NTID As String
NTID = txtNTID.Text
Dim Direct As String = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=C:\DATA\ACCESS\13FloorEquipment.mdb"
Dim strSQL As String = "SELECT [ID], [ItemName], [StartDate],[EndDate],[NTID] FROM(Requests) "
strSQL = strSQL & "Where(([NTID]='" & NTID & "'));"
Dim conn As OleDbConnection = New OleDbConnection(Direct)
Dim Xa As OleDbDataAdapter
Xa = New OleDbDataAdapter(strSQL, conn)
Dim Xs As New DataSet()
Xa.Fill(Xs, "Requests")
DataGrid1.DataSource = Xs.Tables("Requests").DefaultView
End Sub