Link to home
Start Free TrialLog in
Avatar of Basicfarmer
BasicfarmerFlag for United States of America

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").

    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

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Tom
Tom
Flag of Norway image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of ElrondCT
ElrondCT
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Basicfarmer

ASKER

Thanks for the great tips guys...