I have a SQL Server database with two tables:
tblEmp with columns:
EmpNum, EmpName, EmpAge, EmpAdress, EmpDegree, EmpJobTitle, EmpPhone
and the column UnitID that used to set the relationship between the two tables
tblUnits with columns:
UnitID, UnitName
In VB the code is:
Public Class Form1
Dim con As New SqlConnection("server=.....etc")
Dim adapter As SqlDataAdapter
Dim dt As New DataTable
Dim cmdb As New SqlCommandBuilder
Private Sub btnUpdate_Click.......
Dim row As DataRow = dt.Rows.Find(txtNum.Text)
row(0) = txtNum.Text
row(1) = txtName.Text
row(2) = txtAge.Text
row(3) = txtAdress.Text
row(4) = txtDegree.Text
row(5) = txtJob.Text
row(6) = txtPhone.Text
row(7) = cmbunits.Text
cmdb = New SqlCommandBuilder(adapter)
adapter.Update(dt)
I get this error:
Additional information: Dynamic SQL generation is not supported against multiple base tables.