Could not create the driver from NHibernate.Driver.MySqlDataDriver
Posted by: ugur sever
Date: September 17, 2007 02:16AM

Hello;
i'm so new for nhibernate and i didn't solve this problem:

"Could not create the driver from NHibernate.Driver.MySqlDataDriver"

i installed nhibernate 1.2 and mysql .net connector 5.1 but the problem cannot be solve...

my "c# class" and "web.config" file is below:


this is my c# class:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using NHibernate;
using NHibernate.Cfg;
using MySql;
using MySql.Data;

namespace WebApplicationNHibernate
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
NHibernate.Cfg.Configuration cfg = new NHibernate.Cfg.Configuration();
cfg.AddAssembly("WebApplicationNHibernate");
cfg.SetProperty("hibernate.connection.provider", "NHibernate.Connection.DriverConnectionProvider");
cfg.SetProperty("hibernate.connection.driver_class", "NHibernate.Driver.MySqlDataDriver");
cfg.SetProperty("hibernate.connection.connection_string", "Server=localhost;Database=test;User ID=root;Password=100201006;");
ISessionFactory factory = cfg.BuildSessionFactory();
ISession session = factory.OpenSession();
ITransaction trn = session.BeginTransaction();

Ogrenci yeniOgrenci = new Ogrenci();
yeniOgrenci.Id = 1;
yeniOgrenci.Ad = "Ugur";
session.Save(yeniOgrenci);
trn.Commit();
session.Close();
Response.Write("Ogrenci eklendi");
}
}
}

-------------------------------------

this is my web.config file:

<configSections>
<section
name="nhibernate"
type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
/>
</configSections>

<nhibernate>
<add key="hibernate.connection.provider"
value="NHibernate.Connection.DriverConnectionProvider" />

<add key="hibernate.dialect"
value="NHibernate.Dialect.MySQLDialect" />

<add key="hibernate.connection.driver_class"
value="NHibernate.Driver.MySqlDataDriver" />

<add key="hibernate.connection.connection_string"
value="Server=localhost;Database=test;User ID=root;Password=****;CharSet=win1250" />

</nhibernate>

------------------------------------

please help me!..

Options: ReplyQuote


Subject
Written By
Posted
Could not create the driver from NHibernate.Driver.MySqlDataDriver
September 17, 2007 02:16AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.