Basicfarmer
asked on
Help with Datagrid and Access Database
Experts would someone please show me an example of how to use my datagrid with my access database so that when I make changes to the data grid those changes are reflected in the database?
Below is how i am filling the datagrid.
The SQL query is passed as an argument to my procedure because I have a search function so the user can search the records. When the user presses the search button the query is built and passed to the fillEquipment procedure which displays the records in the datagrid. When the form loads the the procedure is called like fillEquipment("SELECT * FROM Equipment").
Below is how i am filling the datagrid.
The SQL query is passed as an argument to my procedure because I have a search function so the user can search the records. When the user presses the search button the query is built and passed to the fillEquipment procedure which displays the records in the datagrid. When the form loads the the procedure is called like fillEquipment("SELECT * FROM Equipment").
Public Sub fillEquipment(strSql As String)
Dim da As New OleDbDataAdapter(strSql, con)
Dim dt As New DataTable
da = New OleDbDataAdapter(strSql, con)
da.Fill(dt)
DataGridView1.DataSource = dt
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER