P
Peter
I am moving data from one Access table to another.
the following code works for most of the tables except one:
I get "System.Data.OleDb.OleDbException: Syntax error in INSERT INTO
statement"
How can I get the entire SQL insert string to find out what is causing the
Syntax error?
//--------------------------------------------------------------------------
--------------------
dataRow = dataTable.NewRow();
foreach(DataColumn cl in dsNew.Tables[0].Columns)
{
dataRow[cl.ColumnName] = dr[cl.ColumnName];
}
dataTable.Rows.Add(dataRow);
this._dt.UpdateImportData(adapter, dsCurrent, importInfo.TableName);
//
//
//
public void UpdateImportData(OleDbDataAdapter adapter, DataSet ds, string
tableName)
{
try
{
adapter.Update(ds, tableName); // this is where the error
occurs
adapter.Dispose();
}
catch(Exception e)
{
throw new Exception(e.ToString());
}
}
Peter
the following code works for most of the tables except one:
I get "System.Data.OleDb.OleDbException: Syntax error in INSERT INTO
statement"
How can I get the entire SQL insert string to find out what is causing the
Syntax error?
//--------------------------------------------------------------------------
--------------------
dataRow = dataTable.NewRow();
foreach(DataColumn cl in dsNew.Tables[0].Columns)
{
dataRow[cl.ColumnName] = dr[cl.ColumnName];
}
dataTable.Rows.Add(dataRow);
this._dt.UpdateImportData(adapter, dsCurrent, importInfo.TableName);
//
//
//
public void UpdateImportData(OleDbDataAdapter adapter, DataSet ds, string
tableName)
{
try
{
adapter.Update(ds, tableName); // this is where the error
occurs
adapter.Dispose();
}
catch(Exception e)
{
throw new Exception(e.ToString());
}
}
Peter