Syntax error. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.OleDb.OleDbException: Syntax error. Source Error: Line 231: Line 232: Line 233: this.Save(this.oAssist); Line 234: //this.Save(this.oAssist, mydataset, this.oAssist.TableName); Line 235: ///////////////////////////////////// Source File: C:\Inetpub\wwwroot\2004_gmg Web Application\QuikButtonEdit.aspx.cs Line: 233 Stack Trace: [OleDbException (0x80040e14): Syntax error.] System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping) System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String srcTable) OakLeaf.MM.Main.Data.mmDataAccessOleDb.SaveDataSet(DataSet ds, String tableName, String primaryKeyName, Boolean retrieveAutoIncrementPK, IDbDataAdapter dbAdapter) OakLeaf.MM.Main.Business.mmBusinessObject.SaveDataSet(DataSet ds, String tableName, String databaseKey, IDbDataAdapter dbAdapter) OakLeaf.MM.Main.Business.mmBusinessObject.SaveDataSet(DataSet ds, String tableName, String databaseKey) OakLeaf.MM.Main.Business.mmBusinessObject.SaveDataSet(DataSet ds, String tableName) OakLeaf.MM.Main.Business.mmBusinessObject.SaveDataSet(DataSet ds)My bizobj is called Assist.cs. I have added the following code so that it will use my CustomDataClass:
protected override mmDataAccessBase CreateDataAccessObject(string DataAccessName) { return new AssistDataAccessOleDb(); }AssistDataAccessOleDb.cs looks like this:
using System; using System.Data; using OakLeaf.MM.Main.Data; namespace eCentric.gmg.Business { /// <summary> /// Summary description for AssistDataAccessOleDb. /// </summary> public class AssistDataAccessOleDb : mmDataAccessOleDb { private System.Data.OleDb.OleDbDataAdapter oleDbDataAdapter1; private System.Data.OleDb.OleDbCommand oleDbSelectCommand1; private System.Data.OleDb.OleDbCommand oleDbInsertCommand1; private System.Data.OleDb.OleDbCommand oleDbUpdateCommand1; private System.Data.OleDb.OleDbCommand oleDbDeleteCommand1; private void InitializeComponent() { this.oleDbDataAdapter1 = new System.Data.OleDb.OleDbDataAdapter(); this.oleDbSelectCommand1 = new System.Data.OleDb.OleDbCommand(); this.oleDbInsertCommand1 = new System.Data.OleDb.OleDbCommand(); this.oleDbUpdateCommand1 = new System.Data.OleDb.OleDbCommand(); this.oleDbDeleteCommand1 = new System.Data.OleDb.OleDbCommand(); // // oleDbDataAdapter1 // this.oleDbDataAdapter1.UpdateCommand = this.oleDbUpdateCommand1; this.oleDbDataAdapter1.InsertCommand = this.oleDbInsertCommand1; this.oleDbDataAdapter1.DeleteCommand = this.oleDbDeleteCommand1; this.oleDbDataAdapter1.SelectCommand = this.oleDbSelectCommand1; this.oleDbDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] { new System.Data.Common.DataTableMapping("Table", "Assist", new System.Data.Common.DataColumnMapping[] { new System.Data.Common.DataColumnMapping("IID", "IID"), new System.Data.Common.DataColumnMapping("VALUE", "VALUE"), new System.Data.Common.DataColumnMapping("DISPLAYVALUE", "DISPLAYVALUE") })}); // // oleDbSelectCommand1 // this.oleDbSelectCommand1.CommandText = "SELECT IID, VALUE, DISPLAYVALUE FROM Assist"; // // oleDbInsertCommand1 // this.oleDbInsertCommand1.CommandText = "INSERT INTO Assist(IID, VALUE, DISPLAYVALUE) " + "VALUES(?, ?, ?)"; this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("IID", System.Data.OleDb.OleDbType.Integer, 4, "IID")); this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("VALUE", System.Data.OleDb.OleDbType.VarChar, 6, "VALUE")); this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("DISPLAYVALUE", System.Data.OleDb.OleDbType.VarChar, 12, "DISPLAYVALUE")); // // oleDbUpdateCommand1 // this.oleDbUpdateCommand1.CommandText = "UPDATE Assist SET IID = ?, VALUE = ?, DISPLAYVALUE = ? WHERE iid = ? " ; this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("?IID", System.Data.OleDb.OleDbType.Integer, 4, "IID")); this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("?VALUE", System.Data.OleDb.OleDbType.VarChar, 6, "VALUE")); this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("?DISPLAYVALUE", System.Data.OleDb.OleDbType.VarChar, 12, "DISPLAYVALUE")); this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("?iid", System.Data.OleDb.OleDbType.Integer, 4, "iid")); // // oleDbDeleteCommand1 // this.oleDbDeleteCommand1.CommandText = "DELETE FROM Assist WHERE iid = ?"; this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("?iid", System.Data.OleDb.OleDbType.Integer, 4, "iid")); } /// <summary> /// Constructor /// </summary> public AssistDataAccessOleDb() { this.InitializeComponent(); } /// <summary> /// Returns an instance of the custom data adapter /// </summary> /// <returns></returns> public override System.Data.IDataAdapter CreateDataAdapter() { return this.oleDbDataAdapter1; } } }Please read through my CustomDataClass an indicate where the potential problem is....