Avatar of DColin
DColin
Flag for Thailand asked on

Update database from DataGridView.

Hi Experts,

I am populating a DataGridView control using the attached code. Once the user has finished updating the information (Goals scored) the database needs to be updated with this new information. The MatchDate And HomeTeam column provide a unique row identifier. How can I do this, thanks?
Dim SQL As String = "SELECT MatchDate, HomeTeam, AwayTeam, HomeGoals, AwayGoals FROM tblFixtures WHERE MatchDate = '04/04/08'"
Dim cn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='db1.mdb';"
 
Dim adapter As New OleDb.OleDbDataAdapter(SQL, cn)
 
Dim table As New DataTable()
 
adapter.Fill(table)
 
DataGridView1.DataSource = table

Open in new window

Visual Basic.NET

Avatar of undefined
Last Comment
Jorge Paulino

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Jorge Paulino

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes