Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error when saving!
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01161662
Message ID:
01161954
Views:
15
>>
>>It gives an error below:
>>
>>Dynamic SQL generation is not supported against multiple base tables.
>>
>>BTW, the error is pointing to the this.oPsDatacenter.SaveDataSet() command.
>>
>>I use mmUltraButtonNew and mmUltraButtonSave but it gives me the same error but this time code looks like below:
>>
>
>Does your initial query in the business object join two tables together? If so, that's the problem.
>
>ADO.NET tries to dynamically generate the SQL statement to do an update and will fail if the initial source is made up of two (or more) tables. To get around this, follow the instructions in the docs to create a custom data access class (Data Access with Business Objects > Creating Custom Data Access Classes). This will force it to use the generated INSERT/UPDATE/DELETE that was created from this step instead of trying to dynamically build it.

I tried to create custom business object class by following the steps stated in the docs. Step 4 is stating that the it should override CreateDataAccessObject method. So I added the code below:
protected override mmDataAccessBase CreateDataAccessObject(string dataAccessClassName)
{
    return new AppsysUsersDataAccessSql();
}
When compiling, it gives me this error:
Error 1 'BizBox.BizObj.SysConfigs.AppsysUsersDataAccessSql.CreateDataAccessObject(string)': no suitable method found to override

What's wrong with what I did?

To give you an idea, the code now looks like below. Ofcourse the long InitializeComponent method has been collapsed.
using System;
using System.Data;

using OakLeaf.MM.Main.Business;
using OakLeaf.MM.Main.Data;

namespace BizBox.BizObj.SysConfigs
{
    /// <summary>
    /// Summary description for AppsysUsersDataAccessSql.
    /// </summary>
    public class AppsysUsersDataAccessSql : mmDataAccessSql
    {
        private System.Data.SqlClient.SqlCommand sqlSelectCommand1;
        private System.Data.SqlClient.SqlCommand sqlInsertCommand1;
        private System.Data.SqlClient.SqlCommand sqlUpdateCommand1;
        private System.Data.SqlClient.SqlCommand sqlDeleteCommand1;
        private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;
        /// <summary>
        /// Constructor
        /// </summary>
        public AppsysUsersDataAccessSql()
        {
            this.TableName = "AppsysUsers";
            this.PrimaryKey = "userdcno";
        }

+       private void InitializeComponent()

-       public override System.Data.IDataAdapter CreateDataAdapter()
        {
            return this.sqlDataAdapter1;
        }

-       protected override mmDataAccessBase CreateDataAccessObject(string dataAccessClassName)
        {
            return new AppsysUsersDataAccessSql();
        }
    }
}
JESS S. BANAGA
Project Leader - SDD division
...shifting from VFP to C#.Net

CHARISMA simply means: "Be more concerned about making others feel good about themselves than you are in making them feel good about you."
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform