在VS2005中用"文件系统"方式打开都运行得好好的,可部署到了IIS却提示.无法打开登录所请求的数据库 "cms"。登录失败?
解决的方式:1:使用调试的HTTP地址:http://localhost:1801/CMS/Default.aspx
注意 在IIS调试时没有端口号。可以自己添加端口号如:1801
2:本地链接<add name="CMSConnectionString" connectionString="Data Source=JGT06/SQLEXPRESS;Initial Catalog=CMS;Integrated Security=true "
providerName="System.Data.SqlClient" />
改为直接连接数据库文件
<add name="CMSConnectionString" connectionString="Data Source=JGT06/SQLEXPRESS;Initial Catalog=CMS;Integrated Security=True "
providerName="System.Data.SqlClient" />
3:查看网站数据库得访问权限设置:右点击属性->安全 设置用户得权限。