Hi,
A total newbie question. I just started using .NET coming from the Java world. I'm trying to use the examples from
http://nhibernate.sourceforge.net/NHibe ... ibernateEg
but I can't seem to connect to SQL Server express 2005. I configured the user "ORMExample" and I could log in using the SQL Management express Studio, create database and everything. Granted it permission on the "nhibernate" databae, but no matter what I do, I still get connection error.
System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.
This is my connection string
<add key="MSSQL.ConnectionString" value="Server=(local);Database=nhibernatet;User=ORMExample;Pwd=changeme!;" />
Please help.
Hibernate version: 0.8
Mapping documents: ?
Code between sessionFactory.openSession() and session.close():
transaction = session.BeginTransaction();
for(int i=0; i<n; i++)
{
Order o = new Order();
o.Product = "P" + (i+1).ToString();
o.Quantity = n - i;
o.ComputeTotalPrice(i * 10 + n);
session.Save(o);
}
Full stack trace of any exception that occurs:
2006-01-08 23:23:19,671 [1360] INFO NHibernate.Dialect.Dialect [(null)] <(null)> - Using dialect: NHibernate.Dialect.MsSql2000Dialect
2006-01-08 23:23:19,703 [1360] INFO NHibernate.Cfg.Binder [(null)] <(null)> - Mapping class: NHibernateEg.Tutorial1A.Order -> SimpleOrder
2006-01-08 23:23:19,734 [1360] INFO NHibernate.Dialect.Dialect [(null)] <(null)> - Using dialect: NHibernate.Dialect.MsSql2000Dialect
2006-01-08 23:23:19,734 [1360] INFO NHibernate.Cfg.Configuration [(null)] <(null)> - processing one-to-many association mappings
2006-01-08 23:23:19,734 [1360] INFO NHibernate.Cfg.Configuration [(null)] <(null)> - processing one-to-one association property references
2006-01-08 23:23:19,734 [1360] INFO NHibernate.Cfg.Configuration [(null)] <(null)> - processing foreign key constraints
2006-01-08 23:23:19,750 [1360] INFO NHibernate.Cfg.Configuration [(null)] <(null)> - processing one-to-many association mappings
2006-01-08 23:23:19,750 [1360] INFO NHibernate.Cfg.Configuration [(null)] <(null)> - processing one-to-one association property references
2006-01-08 23:23:19,750 [1360] INFO NHibernate.Cfg.Configuration [(null)] <(null)> - processing foreign key constraints
2006-01-08 23:23:19,750 [1360] INFO NHibernate.Connection.ConnectionProviderFactory [(null)] <(null)> - Intitializing connection provider: NHibernate.Connection.DriverConnectionProvider
2006-01-08 23:23:19,750 [1360] INFO NHibernate.Connection.ConnectionProvider [(null)] <(null)> - Configuring ConnectionProvider
2006-01-08 23:23:40,328 [1360] ERROR NHibernate.ADOException [(null)] <(null)> - Could not create connection from Driver
System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.
at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at NHibernate.Connection.DriverConnectionProvider.GetConnection()
Name and version of the database you are using: Sql Sever Express 2005
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: