Hi All,
I have code where I load data from database into dataviewgrid, but have problem with update. I tried to replace select for update but without any changes. Any ideas?
I have code where I load data from database into dataviewgrid, but have problem with update. I tried to replace select for update but without any changes. Any ideas?
VB.NET:
Public Class Form1
Public connstring As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|datadirectory|\line_balance.accdb;persist security info = false"
Public conn As New OleDbConnection
Private Sub load_times_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles load_times.Click
Dim TblTime As String = "SELECT * FROM TblTime" Dim Sqlcommand As New OleDbCommand
Dim SqlAdapter As New OleDbDataAdapter
Dim TABLE As New DataTable
With Sqlcommand
.CommandText = TblTime
.Connection = conn
End With
With SqlAdapter
.SelectCommand = Sqlcommand
.Fill(TABLE)
End With
For i = 0 To TABLE.Rows.Count - 1
With group_table
.Rows.Add(TABLE.Rows(i)("Group"), TABLE.Rows(i)("Task"), TABLE.Rows(i)("Time"), TABLE.Rows(i)("TimeDesc"), TABLE.Rows(i)("Station"), TABLE.Rows(i)("Multiple"))
End With
Next i
End Sub
End Sub