Getting started: NHibernate + SQLExpress

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • beantaxi@gmail.com

    Getting started: NHibernate + SQLExpress

    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 .SessionFactory Impl.OpenConnec tion()
    at NHibernate.Impl .SessionImpl.ge t_Connection()
    at NHibernate.Tran saction.AdoTran saction.Begin(I solationLevel
    isolationLevel)
    (etc)


    Below is my configuration, which seems straightforward to me.

    <nhibernate>
    <add key="hibernate. connection.prov ider"
    value="NHiberna te.Connection.D riverConnection Provider"/>
    <add key="hibernate. connection.driv er_class"
    value="NHiberna te.Driver.SqlCl ientDriver"/>
    <add key="hibernate. connection.conn ection_string" value="Data
    Source=.\SQLEXP RESS;AttachDbFi lename=|DataDir ectory|
    \testdb.mdf;Int egrated Security=True;C onnect Timeout=30;User
    Instance=True"/>
    <add key="hibernate. connection.isol ation" value="ReadComm itted" />
    <add key="hibernate. dialect"
    value="NHiberna te.Dialect.MsSq l2000Dialect"/>
    </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 + SQLServerExpres s working locally?

    Thanks,
    Taxi

Working...