-->
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.  [ 7 posts ] 
Author Message
 Post subject: SQL Express Connection Problem
PostPosted: Mon Jun 25, 2007 6:49 pm 
Newbie

Joined: Fri Jun 22, 2007 11:14 am
Posts: 4
I am having a problem connecting to SQL Express with vb.net.

The error message I am getting is:

"{"Keyword not supported: '.\sqlexpress;attachdbfilename'."}"

Has anyone had this problem or has a sample connection string for SQL Express?


Top
 Profile  
 
 Post subject: Re: SQL Express Connection Problem
PostPosted: Wed Jun 27, 2007 1:12 am 
Regular
Regular

Joined: Fri Feb 18, 2005 3:34 am
Posts: 88
Location: Poland/Wrocław
mcelwvi wrote:
"{"Keyword not supported: '.\sqlexpress;attachdbfilename'."}"


Could you provide some more details? The exception you get, the connection string, NH configuration?

_________________
Please rate this post if you've found it helpfull
Roland


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 27, 2007 4:28 pm 
Newbie

Joined: Fri Jun 22, 2007 11:14 am
Posts: 4
The app.config settings are as follows:

<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.MsSql2005Dialect"/>
<add key="hibernate.connection.driver_class" value="NHibernate.Driver.SqlClientDriver"/>
<add key="hibernate.connection.connection_string" value=".\SQLEXPRESS;AttachDbFilename=TestDB.mdf;Integrated Security=True;User Instance=True"/>
</nhibernate>

My very simplified code is as follows:


Dim tran As NHibernate.ITransaction
Dim cfg As Configuration = New Configuration
factory = cfg.BuildSessionFactory

session = factory.OpenSession()
tran = session.Transaction

tran.Begin()

session.Save(Me)
tran.Commit()


I am getting an error at the "tran = session.Transaction" line

Please Help


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 27, 2007 4:55 pm 
Hibernate Team
Hibernate Team

Joined: Tue Jun 13, 2006 11:29 pm
Posts: 315
Location: Calgary, Alberta, Canada
Your connection string is not well-formed. You need "Data Source=.\SQLEXPRESS" or "Server=.\SQLEXPRESS".

_________________
Karl Chu


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 27, 2007 5:16 pm 
Newbie

Joined: Fri Jun 22, 2007 11:14 am
Posts: 4
Karl,

Can you be a bit clearer?

Do you mean add a new key?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 27, 2007 5:22 pm 
Hibernate Team
Hibernate Team

Joined: Tue Jun 13, 2006 11:29 pm
Posts: 315
Location: Calgary, Alberta, Canada
Make the connection string this:
Code:
Data Source=.\SQLEXPRESS;AttachDbFilename=TestDB.mdf;Integrated Security=True;User Instance=True

or this:
Code:
Server=.\SQLEXPRESS;AttachDbFilename=TestDB.mdf;Integrated Security=True;User Instance=True

_________________
Karl Chu


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 27, 2007 5:54 pm 
Newbie

Joined: Fri Jun 22, 2007 11:14 am
Posts: 4
Thanks Karl... That worked perfectly


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 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.