2012-07-18 68 views
2

我想知道如何将以下数据源从Ip更改为虚拟目录中我的mvc3项目上的localhost。mvc connectionstrings问题

<connectionStrings> 
    <add name="ApplicationServices" connectionString="Data Source=xx.xx.xx.xx;Initial Catalog=aspnetdb;Persist Security Info=True;User ID=xxxCompany;[email protected]"/> 
    <add name="DATABASEContext" connectionString="Data Source=xx.xx.xx.xx;Initial Catalog=DATABASEContext;Persist Security Info=True;User ID=xxxCompany;[email protected]; MultipleActiveResultSets=True" providerName="System.Data.SqlClient"/> 
</connectionStrings> 

任何帮助将不胜感激!

回答

0

使用期间.。 SQL Server将句点翻译为本地主机。您可能需要包含实例名称。如果您使用SQLExpress,则很可能使用./SQLEXPRESS作为数据源。

+0

谢谢,你能更具体吗? – user1155430 2012-07-18 15:35:18

+0

关于什么更具体?你需要澄清什么? – 2012-07-18 15:35:49

+0

对不起。但是当我改变它时,它仍然给我错误,如“与SQL Server建立连接时发生网络相关或实例特定的错误”。 – user1155430 2012-07-18 15:38:22