我有一个曾经在sqlexpress数据库上运行的网站我改变了我的服务器并且它停止运行我使用visual studi和IIS运行它但是它给了我错误404或错误503我觉得问题出在我的webconfig sql字符串连接她是我的代码:
<connectionStrings>
<add name="SiteSqlServer" connectionString="Data Source=localhost;Initial Catalog=ULTRA; User ID=admin;Password=123" providerName="System.Data.SqlClient" />
<add name="SiteSqlServer" connectionString="Server=(local);Database=DotNetNuke;uid=;pwd=;" providerName="System.Data.SqlClient" />
-->
<!-- Connection String for SQL Server 2008/2012 Express -->
<!--<add name="SiteSqlServer" connectionString="Data Source=localhost;Initial Catalog=ULTRA; User ID=admin;Password=123" providerName="System.Data.SqlClient" />-->
<!-- Connection String for SQL Server 2008/2012
-->
<!--<add name="SiteSqlServer" connectionString="Server=(local);Database=DotNetNuke;uid=;pwd=;" providerName="System.Data.SqlClient" />-->
</connectionStrings>
<appSettings>
<!-- Connection String for SQL Server 2008/2012 Express - kept for backwards compatability - legacy modules -->
<!--<add key="SiteSqlServer" value="Data Source=.\SQLExpress;AttachDbFilename=|DataDirectory|Database.mdf;Integrated Security=True;User Instance=True" />-->
<!-- Connection String for SQL Server 2008/2012 - kept for backwards compatability - legacy modules
-->
<add key="SiteSqlServer" value="Server=(local);Database=DotNetNuke;uid=;pwd=;" />
有人请帮我告诉我出了什么问题吗?
答案 0 :(得分:0)
您在web.config的ConnectionStrings部分中多次定义了连接字符串。哪个是正确的连接字符串?
编辑: 您可能遇到PortalAliases和IIS配置问题。您尝试使用的网址是什么?确保PortalAliases表中列出了URL,同时确保IIS也会响应URL。