Login Skip Navigation LinksWilsonORMapper > Forums Search
Demo Version Demo Version
Download and try for yourself a fully working demo version, including sample apps and documentation.  The only limitation is that the demo version only works inside the debugger.

PayPal Subscribe
Get It All for $50 USD:
WebPortal, ORMapper,
Source Code, All Updates
PayPal

User Login User Login
Log In
 
 
Reset Password

Wilson ORMapper Forums Wilson ORMapper Forums : Other Databases : MySql connection string

Date Post
9/18/2005 8:40:02 AM Hi all,

I'm using the MySQL ADO.Net Data Provider 1.0.4 to connecto to MySQL and I'm getting a "ObjectSpace: Connection String is Invalid - Specified cast is not valid." error when calling a method on the ObjectSpace object.

Can anyone tell me what's wrong with my connection string?

Thanks,

Francis

string connection = "Database=mydb;host=localhost;port=3306;uid=username;pwd=password;";
CustomProvider provider = new CustomProvider("MySql.Data", "MySql.Data.MySqlClient.MySqlConnection", "MySql.Data.MySqlClient.MySqlDataAdapter"); provider.StartDelimiter = "`"; provider.EndDelimiter = "`"; provider.ParameterPrefix = "?"; provider.IdentityQuery = "SELECT LAST_INSERT_ID()"; provider.SelectPageQuery = "SELECT * LIMIT {0} OFFSET {1}";
mapper = new ObjectSpace(Assembly.GetExecutingAssembly().GetManifestResourceStream("MyNameSpace.Mappings.config"), connection, provider);
9/19/2005 4:15:23 AM Does that connection string work for you outside of the mapper? I've always used server=localhost instead of host=localhost, but that may not be a problem either since there are often multiple possibilities. So the test is really does your connection string work outside of the mapper?

If it does, then the only other thing I can think of is whether or not your MySql provider can be found. Is the MySql provider installed in your GAC or is the dll in your local bin directory?

Thanks, Paul Wilson
9/19/2005 5:52:00 PM MySQL Connector 1.04 is defective, upgrading to MySQL Connector/Net 1.05 solved the problem.

Thanks,

Francis