Thank you! Actually I had to change "driver_class" property, "dialect"
had been set to "MsSql2005Dialect".
For anyone who would have this kind of problem, here is my working
hibernate.cfg.xml:

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
  <session-factory>
    <property
name="connection.provider">NHibernate.Connection.DriverConnectionProvider</
property>
    <property name="dialect">NHibernate.Dialect.MsSql2005Dialect</
property>
    <property
name="connection.driver_class">NHibernate.Driver.SqlClientDriver</
property>
    <property name="connection.connection_string">
      Data Source=.\SQLEXPRESS;Initial Catalog=nhibernate;Integrated
Security=True;
    </property>
    <property name="show_sql">true</property>
  </session-factory>
</hibernate-configuration>

On 12 Bře, 21:41, Ryan Rinaldi <[email protected]> wrote:
> Yeah, just re-read your first email.  Change the dialect to the MS Sql
> dialect (full name escapes me right now).
>
> -Ryan Rinaldi
> blog:http://ryanrinaldi.com
>
> 2009/3/12 Ryan Rinaldi <[email protected]>
>
> > What dialect and driver are you using?  I have a feeling you are using the
> > SqlCe instead of the MS SQL.
>
> > -Ryan Rinaldi
> > blog:http://ryanrinaldi.com
>
> > 2009/3/12 steves <[email protected]>
>
> >> No, of course I can connect to dabatase trought Server Explorer and
> >> event if I pass that first connection string to SqlConnection
> >> constructor and then open the connection, it works.
>
> >> On 12 Bře, 19:17, James Gregory <[email protected]> wrote:
> >> > So you can't even connect to the database through Server Explorer? If so
> >> > then there's a more fundamental issue at hand than just NHibernate.
>
> >> > 2009/3/12 steves <[email protected]>
>
> >> > > Yes, I tried these connection strings, but it did not work as well.
>
> >> > > This one was generated by Server Exprorer in Visual Studio:
> >> > > "Data Source=.\SQLEXPRESS;Initial Catalog=nhibernate;Integrated
> >> > > Security=True"
> >> > > error: "Additional information: Unknown connection option in
> >> > > connection string: initial catalog."
>
> >> > > than I tried this:
> >> > > "Data Source=.\SQLEXPRESS.nhibernate.dbo;"
> >> > > error: "The database file cannot be found. Check the path to the
> >> > > database. [ Data Source = .\SQLEXPRESS.nhibernate.dbo ]"
>
> >> > > So basicaly I should keep trying until I find some which works? Sounds
> >> > > strange.
>
> >> > > On 12 Bře, 16:23, Dario Quintana <[email protected]>
> >> > > wrote:
> >> > > > There is not such "server" word in those connection strings. Try
> >> with
> >> > > "Data
> >> > > > Source" or "Server"
>
> >> > > > On Thu, Mar 12, 2009 at 1:14 PM, steves <[email protected]>
> >> wrote:
>
> >> > > > > I am sorry for a beginner question, but I cannot go trough this.
>
> >> > > > > I have SQL EXPRESS server installed, using .NET 3.5. I have
> >> > > > > downloaded  examples via svn at address "http://
> >> > > > > hibernatingrhinos.googlecode.com/svn/trunk" and tried
> >> "FirstSolution"
> >> > > > > example.
>
> >> > > > > It works well, but it uses local db file. When I tried to change
> >> > > > > connection string for to connect to SQL server,
> >> > > > > I got error "Unknown connection option in connection string:
> >> server."
> >> > > > > If I change connection string somehow, I get similar errors.
>
> >> > > > > My hibernate.cfg.xml file:
>
> >> > > > > <?xml version="1.0" encoding="utf-8" ?>
> >> > > > > <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
> >> > > > >  <session-factory>
> >> > > > >    <property
>
> >> name="connection.provider">NHibernate.Connection.DriverConnectionProvider</
> >> > > > > property>
> >> > > > >    <property name="dialect">NHibernate.Dialect.MsSql2005Dialect</
> >> > > > > property>
> >> > > > >    <property
>
> >> name="connection.driver_class">NHibernate.Driver.SqlServerCeDriver</
> >> > > > > property>
> >> > > > >    <property
> >> name="connection.connection_string">Server=.\SQLEXPRESS;
> >> > > > > Initial Catalog=NHExample; Integrated Security=SSPI</property>
> >> > > > >    <property name="show_sql">true</property>
> >> > > > >  </session-factory>
> >> > > > > </hibernate-configuration>
>
> >> > > > > Various connection strings I tried:
> >> > > > > "Server=(local)\SQLEXPRESS; Initial Catalog=NHExample; Integrated
> >> > > > > Security=SSPI"
> >> > > > > "Server=127.0.0.1\SQLEXPRESS; Initial Catalog=NHExample;
> >> Integrated
> >> > > > > Security=SSPI"
> >> > > > > etc.
>
> >> > > > --
> >> > > > Dario Quintanahttp://darioquintana.com.ar
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to