Hello,
I have the following problem
A datagrid binded to a dataset. The dataset gets data from a database through a dataAdapter. The data is comming from 2 tables in the database.
Dim da as new oledbDataAdapter ("Select F1 F2 .. from Table1 inner join Table2" , connection)
The goal is to let the user edit data in the datagrid and then click a button to update the database.
I test this and it works when the data comes from a single table such as :
Dim da as new oledbDataAdapter ("Select F1 F2 .. from Table1" , connection)
When the data comes from two tables I get the following error message
"Dynamic SQL generation is not supported against multiple base tables"
Is there a way to achieve this ?
I am thinking that it may be possible to use 2 dataAdapter one for each table and also use the original dataAdapter with the sql join query.
another important detail is that I use commandbuilder here is the code for the update functionality
I appreciate any help.
I have the following problem
A datagrid binded to a dataset. The dataset gets data from a database through a dataAdapter. The data is comming from 2 tables in the database.
Dim da as new oledbDataAdapter ("Select F1 F2 .. from Table1 inner join Table2" , connection)
The goal is to let the user edit data in the datagrid and then click a button to update the database.
I test this and it works when the data comes from a single table such as :
Dim da as new oledbDataAdapter ("Select F1 F2 .. from Table1" , connection)
When the data comes from two tables I get the following error message
"Dynamic SQL generation is not supported against multiple base tables"
Is there a way to achieve this ?
I am thinking that it may be possible to use 2 dataAdapter one for each table and also use the original dataAdapter with the sql join query.
another important detail is that I use commandbuilder here is the code for the update functionality
VB.NET:
Dim newds As DataSet = ds.GetChanges()
DataGrid2.DataSource = newds
Dim cmdbuider As New OleDbCommandBuilder(da)
If newds Is Nothing Then
MsgBox("you haven't done anything")
Else
If da.Update(newds, "person") Then
MsgBox("update successfully")
End If
End If
I appreciate any help.