Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MySQL data Access Class
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01135585
Message ID:
01136485
Views:
9
Stuart,

The good news is, you're not doing anything wrong <s>.

>Error 1 Cannot convert type 'System.Data.Common.DbCommandBuilder'

The bad news is I did a little research and found that MySqlCommandBuilder is not derived from DbCommandBuilder (a BIG mistake on their part). They have had a number of requests to fix this problem. For now, it's not a perfect solution, but you can get around this problem for now by changing the CommandBuilder property to the following (don't call CreateCommandBuilder from the get...instaniate it directly):
protected virtual MySqlCommandBuilder CommandBuilder
{
    get
    {
        // If a Command Builder doesn't exist, create one
        if (this._commandBuilder == null)
        {
            this._commandBuilder = new MySqlCommandBuilder(this.DataAdapter);
        }
        return this._commandBuilder;
    }
    set { this._commandBuilder = value; }
}
Again, you're getting this error because they didn't subclass MySqlCommandBuilder from DbCommandBuilderTo get rid of this error, don't override the CreateCommandBuilder method, which is OK since you're not calling it anyway. So just remove this code from your subclass:
public override DbCommandBuilder CreateCommandBuilder(IDbDataAdapter dataAdapter)
{
     return  new MySqlCommandBuilder((MySqlDataAdapter)dataAdapter);
}
Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform