Hibernate version: 1.2.0 beta 3
Mapping documents:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<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.MsSql2000Dialect"
/>
<add
key="hibernate.connection.driver_class"
value="NHibernate.Driver.SqlClientDriver"
/>
<add
key="hibernate.connection.connection_string"
value="Server=localhost; Initial Catalog=zoom; User ID=zoom;Password=zoom"
/>
<add
key="hibernate.connection.isolation"
value="ReadCommitted"
/>
</nhibernate>
<!-- other app specific config follows -->
</configuration>
Code between sessionFactory.openSession() and session.close():
session = SessionManager.GetSession();
User user = new User();
user.Username = "manu";
user.Password = "test";
user.FirstName = "Manu";
user.LastName = "Kumar";
user.EmailAddress = "
[email protected]";
DataAccess access = new DataAccess();
Console.WriteLine(access.Load("from User" , session));
Full stack trace of any exception that occurs:
Unhandled Exception: NHibernate.ADOException: cannot open connection ---> System
.Data.SqlClient.SqlException: An error has occurred while establishing a connect
ion to the server. When connecting to SQL Server 2005, this failure may be caus
ed by the fact that under the default settings SQL Server does not allow remote
connections. (provider: Named Pipes Provider, error: 40 - Could not open a conne
ction to SQL Server)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception
, Boolean breakConnection)
Name and version of the database you are using:
MS SQL Server 2005 Express Edition
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
I have set the SQL Server connection modes to TCP/IP and Named Pipes and set it to allow connection from both local and remote.
When i try to generate DDL through NHibernate.Tool.hbm2ddl.SchemaExport , it works fine. However , as soon as i try to load a user entity i get this exception.
please help.
regards,
Manu