Hi,
I am having some difficulty connecting to a MySQL database using NHibernate.
I get the error:
Quote:
"Could not create the driver from NHibernate.Driver.MySqlDataDriver"
I have searched for reasons why this might be, and have included MySQL.Data as a reference in the project, but nothing I try seems to resolve the problem.
The more specific inner exception is:
Quote:
"The IDbCommand and IDbConnection implementation in the assembly MySql.Data could not be found. Ensure that the assembly MySql.Data is located in the application directory or in the Global Assembly Cache. If the assembly is in the GAC, use <qualifyAssembly/> element in the application configuration file to specify the full name of the assembly."
I have used the following method to connect to the database:
Code:
props["hibernate.connection.provider"] = "NHibernate.Connection.DriverConnectionProvider";
props["hibernate.dialect"] = "NHibernate.Dialect.MySQLDialect";
props["hibernate.connection.driver_class"] = "NHibernate.Driver.MySqlDataDriver";
props["hibernate.connection.connection_string"] = "Server=localhost;Database=mydatabase;User ID=myusername;Password=mypassword;CharSet=win1250" ;
Where mydatabase, myusername and mypassword are replaced by their correct equivalents.
Any assitance you might be able to give would be gratefully appreciated.