I have just 1 table that I am updating, the SQL I use to generate the
DataTable is complex using multiple tables, however when I view the
fieldnames of the DataTable from the DataSet - everything matches: What dont
I understand here:
( The error I get is : Dynamic SQL generation is not supported against
multiple base tables ). But My DataSet is 1 Table, and my target is 1 table,
Why the error ??
Thanks :
try
{
staticSQLConn.Open();
System.Data.SqlClient.SqlDataAdapter daAdapter = new
SqlDataAdapter(sSQL, staticSQLConn);
daAdapter.AcceptChangesDuringFill = false;
daAdapter.Fill(ds, srcTable); // all entries will be
flagged new
if (ds.HasChanges())
{
rowsToInsert = ds.Tables[srcTable].Rows.Count;
SqlCommandBuilder Cb = new SqlCommandBuilder(daAdapter);
Cb.GetInsertCommand();
DataTable dt = ds.Tables[srcTable];
retVal = daAdapter.Update(dt); // ERROR
}
--
Andrew