Recently, an Asp.net project uses nhib.pdf as the data access layer. All object classes and their ing files pass the nunit test. Move the configuration content of APP. config under the test project to Web. config under the Asp.net project, and the result is "adoexceptin cannot open connection. If you have no plans, try not to use trusted connections. Hahaha, the result is normal.
The following configuration items can be used normally:
< Nhib.pdf >
< Add
Key = "Hibernate. show_ SQL"
Value = "True"
/>
< Add
Key = "Hibernate. Connection. provider"
Value = "Nhib.pdf. Connection. driverconnectionprovider"
/>
< Add
Key = "Hibernate. dialect"
Value = "Nhibect. dialect. mssql2000dialect"
/>
< Add
Key = "Hibernate. Connection. driver_class"
Value = "Nhib.pdf. Driver. sqlclientdriver"
/>
< Add
Key = "Hibernate. Connection. connection_string"
Value = "Server = localhost; initial catalog = supercargo; user id = sa; Password = network"
/>
</ Nhib.pdf >
If you change the last section to "trusted connection ",
<Add
Key = "hibernate. Connection. connection_string"
Value = "Server = localhost; initial catalog = supercargo; Integrated Security = sspi"
/>
When nunit is used for testing, we can pass the test normally. When it is applied to the Asp.net project, we will prompt that the connection cannot be opened.