Hi, I'm using VB 2005, WinForms. I'm trying to add a new record to my Database Tables and am getting the following error message.
>> An unhandled exception of type 'System.InvalidOperationEx
ception' occurred in System.Data.dll
>> Additional information: Dynamic SQL generation is not supported against multiple base tables.
The error happens at this line of code and the code I'm using to perform this operation is listed in the snippet below.
tItems) <<< Error Here
The DataTable referenced here (m_dtItems) gets its data from multiple tables in the database, which are JOINED. However, all the fields that I'm adding (for my new record) are all in the same table.
Any thoughts on how I can resolve this?
Private Sub addNewItem()
Dim drNewRow As DataRow = m_dtItems.NewRow()
drNewRow("ItemName") = Trim(tbxItemName.Text)
drNewRow("ItemType") = Trim(tbxItemType.Text)
drNewRow("ItemPrice") = Trim(tbxItemPrice.Text)
m_cbCommandBuilder = New OleDb.OleDbCommandBuilder(m_daDataAdapter)
m_daDataAdapter.Update(m_dtItems) <<< The error happens here