These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Nhibernate could not create MySQL driver!..
PostPosted: Mon Sep 17, 2007 4:47 am 
Newbie

Joined: Mon Sep 17, 2007 4:39 am
Posts: 5
Hello;
i'm so new for nhibernate&MySQL and i didn't solve this exception:

"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:


Code:
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;

using MySql.Web;

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");

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:


Code:
<configSections>

<section

name="nhibernate"

type="System.Configuration.NameValueSectionHandler, System, Version=1.2.0.4000, 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!..


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 17, 2007 1:45 pm 
Hibernate Team
Hibernate Team

Joined: Tue Jun 13, 2006 11:29 pm
Posts: 315
Location: Calgary, Alberta, Canada
Make sure the MySql.Data.dll is loadable. i.e. it is on your path or in your bin directory.

_________________
Karl Chu


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 21, 2007 1:59 pm 
Newbie

Joined: Wed Nov 21, 2007 1:56 pm
Posts: 1
karlchu wrote:
Make sure the MySql.Data.dll is loadable. i.e. it is on your path or in your bin directory.


Thanks, this was helpful :)

Mark


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.