我已经将SQL 2005数据库导入到我的项目中,并且尝试使用web.config连接到数据库。
但是,当我将connectionString添加到web.config时,出现了此错误。
<add name="strConn" connectionString="Data Source=.\sqlexpress;Initial Catalog=intranet_db;Integrated Security=True"
providerName="System.Data.SqlClient"/>
HTTP错误500.19-内部服务器错误
无法访问请求的页面,因为该页面的相关配置数据无效。详细的错误信息:
请求跟踪目录
C:\ Users \ user \ Documents \ IISExpress \ TraceLogFiles \
我做错了吗?我应该在web.config中添加什么?
谢谢。
请确保将“ add”标签放置在正确的位置。当我将其放置在错误的部分时,我可以重现您的错误。您的web.config文件应如下所示:
<configuration>
<connectionStrings>
<add name="strConn" connectionString="Data Source=.\sqlexpress;Initial Catalog=intranet_db;Integrated Security=True"
providerName="System.Data.SqlClient"/>
</connectionStrings>
</configuration>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句