Dim ObjConnection As New OleDbConnection() Dim i As Integer viewrecordsfrombackup.DataGridView1.SelectedRows(i).Cells("teamcolor").Value = ComboBox1.Text ObjConnection.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & browserec.txtpath.Text & "'" Dim ObjCommand As New OleDbCommand() ObjCommand.Connection = ObjConnection For i = viewrecordsfrombackup.DataGridView1.SelectedRows.Count - 1 To 0 Step -1 ObjCommand.CommandText = "UPDATE table1 SET teamcolor = '" & viewrecordsfrombackup.DataGridView1.SelectedRows(i).Cells("teamcolor").Value & "' where ID like '" & viewrecordsfrombackup.DataGridView1.SelectedRows(i).Cells("ID").Value & " '" ObjConnection.Open() ObjCommand.ExecuteNonQuery() ObjConnection.Close() Next MsgBox("Record(s) updated successfully!")
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)