Hi,
I have a datagridview on a windows form that displays the results from
a query. I need the user to be able to edit data in the datagridview
and thus save any changes made.
The query uses data from 3 seperate tables.
I keep getting the error: "Dynamic SQL generation is not supported
against multiple base tables." when I try to update.
I've been googling this all day, do I have to have seperate insert
statments or something? I understand that I can't do an update to
multiple tables, but how can I get around it?
This is my code:
Public Class frmTodaysAbsentees
Dim objConnection As New OleDb.OleDbConnection( _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source= FYP.mdb")
Dim TodaysAbsentessTableAdapter As New OleDb.OleDbDataAdapter
("Select * from TodaysAbsentees", objConnection)
Dim TodaysAbsenteesCommandBuilder As New OleDb.OleDbCommandBuilder
(TodaysAbsentessTableAdapter)
Private Sub frmTodaysAbsentees_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
Me.TodaysAbsentessTableAdapter.Fill
(Me.DataSet2.TodaysAbsentees)
End Sub
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnSave.Click
TodaysAbsentessTableAdapter.Update(DataSet2.TodaysAbsentees)
DataSet2.AcceptChanges()
End Sub
End Class
Thanks!