tags:

views:

30

answers:

1

Hello, i've crrently got a problem where our applications are using NHibernate implementations where some older parts still use ADO. The problemn i'm having is that ADO requires a provider to be specified in order to work.

Provider=SQLOLEDB.1;Persist Security Info=False;User ID=XXXXX;Initial Catalog=XXXX;Data Source=XX.XXX.XX.XX;Password=XXXXX;

Like so, how ever when i configure NHibernate to use the same connection string i get the following error:

Keyword not supported: 'provider'.

If i remove the provider from the connectionstring all is fine for NHibernate. Now i could just use two connectionstrings but i don't want to do that.

Is there a way to achieve this without having to make two connectionstrings, or fix some flaw in NHibernate?

Greetings,

F.B. ten Kate

+2  A: 

Okay, i figured out i could change the NHibernate driver_class to get things working, changed it to:

<property name="connection.driver_class">NHibernate.Driver.OleDbDriver</property>

from

<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>

Not sure about any performance hits i might take from this but atleast it functions like this.

F.B. ten Kate