Datagridview to access databse's table , not via source binding

  • Thread starter Thread starter Kevin993
  • Start date Start date
K

Kevin993

Guest
I first populate a datagridview with one of the tables of my access database :

Dim dt2 As New DataTable()
dt2.Clear()
Dim adp2 As New OleDb.OleDbDataAdapter("SELECT * FROM Persons", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\datasource\datasource.mdb;Persist Security Info=False;")
adp2.Fill(dt2)
adp2.Dispose()
dgv1.DataSource = dt2


After populating the dgv1, I change value of some of the cells in dgv ,and at the end, I want to update the table in the database with the latest values in my datagridview.

2 questions :

1- How to update only specific column (for example, by giving the column's name) of database table with the corresponding column in datagridview ?

2- How to update whole the table in the database with the datagridview that is corresponding to that table


P.S not via source binding solution

Continue reading...
 
Back
Top