I figured out my problem.

When we use SQL Server in VS2008 connection.connection_string should
be as followed:

<property name="connection.connection_string">Data Source=.
\SQLEXPRESS;AttachDbFilename=|DataDirectory|
<MY_DB_NAME>.mdf;Integrated Security=True;User Instance=True</
property>

|DataDirectory| Point to the database location.

On 29 Dec, 08:51, Sheri <[email protected]> wrote:
> Hello everybody!
>
> I am using embedded SQL Server in VS 2008. and I have the following
> configuration in my "web.conf" file. By the way I am using ASP .NET
> MVC framework.
>
> ______________________________
>
> <configuration>
> <configSections>
>    .....
>    <section name="hibernate-configuration"
> type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" />
> </configSections>
> ...
>   <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
>     <session-factory name="WebMonitorUpdate">
>       <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=MyDatabaseName;Trusted_Connection=true</
> property>
>       <property
> name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFac 
> tory,
> NHibernate.ByteCode.LinFu</property>
>     </session-factory>
>   </hibernate-configuration>
> <configuration>
>
> ______________________________
>
> (I have tested Integrated Security = true (and test with SSPI) too
>
> but I get the following error! It is strange since I do not have any
> username and password:
>
> System.Data.SqlClient.SqlException: Cannot open database
> "WebMonitorUpdate" requested by the login. The login failed.
> Login failed for user 'shso'
>
> Would anyone please help me if you have any idea.
>
> Thanks in advance
> Sheri

--

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