Getting started: NHibernate + SQLExpress

B

beantaxi

Hello all,

I'm trying to write a simple program, using VS C# 2005 Express and SQL
Server Express with NHib 1.0.2. No matter what I try, I'm unable to
connect:

cannot open connection
at NHibernate.Impl.SessionFactoryImpl.OpenConnection()
at NHibernate.Impl.SessionImpl.get_Connection()
at NHibernate.Transaction.AdoTransaction.Begin(IsolationLevel
isolationLevel)
(etc)


Below is my configuration, which seems straightforward to me.

<nhibernate>
<add key="hibernate.connection.provider"
value="NHibernate.Connection.DriverConnectionProvider"/>
<add key="hibernate.connection.driver_class"
value="NHibernate.Driver.SqlClientDriver"/>
<add key="hibernate.connection.connection_string" value="Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|
\testdb.mdf;Integrated Security=True;Connect Timeout=30;User
Instance=True"/>
<add key="hibernate.connection.isolation" value="ReadCommitted" />
<add key="hibernate.dialect"
value="NHibernate.Dialect.MsSql2000Dialect"/>
</nhibernate>

"testdb.mdf" is the db file I created. For my connection string, I'm
actually using what VStudio itself generated, when I created a form
with a DataGridView on the same database. The DGV populated just fine,
but the same connection string in NHib seems to give me problems.

Does anyone have NHib + SQLServerExpress working locally?

Thanks,
Taxi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top