2013-04-25 59 views
0

我开发了一个网站,并在我的网站上有两个数据库。 我在plesk面板中创建了两个数据库和用户并上传备份, 数据库的名字是database_Journal,数据库名称2是database_General,用户也是UserID1和UserID。 但是有一些东西错了它,它给了我这个错误:asp.net中两个数据库的网页配置错误

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

我的web配置是这样的:

<add name="dbconn" connectionString="Password==******;; Persist Security Info=True;User ID=UserID1; Initial Catalog=database_General; Data Source=***.**.**.**" providerName="System.Data.SqlClient" /> 

    <remove name="LocalSqlServer"/> 

    <add name="LocalSqlServer" connectionString="Password=******;Persist Security Info=True;User ID=UserID1; Initial Catalog=database_General; Data Source=***.**.**.**" providerName="System.Data.SqlClient" /> 

    <add name="dbconn_general" connectionString="Password==******;; Persist Security Info=True;User ID=UserID; Initial Catalog=database_Journal; Data Source=***.**.**.**" providerName="System.Data.SqlClient" /> 

回答

0

试试这个格式...

<add name="dbconn" connectionString="server=YourServerNameOrServerIpAddress; database=database_General; uid=UserID1; Password=******" providerName="System.Data.SqlClient" />