esposito
Centurion
Hello, I have a datagrid control bound to an Access database. To populate the datagrid, I use the following code:
What I would like to do is add a hyperlink field to the datagrid that will allow me to delete the selected record.
In WebMatrix (the IDE that I use) it is very easy to transform a field into a hyperlink. What I can't do, as I said, is delete the current record when I click on that hyperlink.
I know it is possible because I have seen a datagrid control implementing that function.
Any help will be appreciated.
Visual Basic:
Dim mykeyword As String = Replace(txtKeyWord.Text, "'", "''")
Dim MySQL as string = "Select * from employees WHERE surname = '" & mykeyword & "' Order by id_employee"
Dim myConn As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & server.mappath("employees.mdb") & ";")
Dim ds as DataSet=New DataSet()
Dim Cmd as New OleDbDataAdapter(MySQL,MyConn)
Cmd.Parameters(0) = myKeyword
Cmd.Fill(ds,"employees")
myDataGrid.Datasource=ds.Tables("employees").DefaultView
myDataGrid.DataBind()
MyConn.Close()
What I would like to do is add a hyperlink field to the datagrid that will allow me to delete the selected record.
In WebMatrix (the IDE that I use) it is very easy to transform a field into a hyperlink. What I can't do, as I said, is delete the current record when I click on that hyperlink.
I know it is possible because I have seen a datagrid control implementing that function.
Any help will be appreciated.