本文介绍了连接字符串中的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我开发了一个在我的本地机器上完美执行的Web应用程序。
我从并行Plesk购买托管服务。我上传了所有文件的地方。
我使用AttachDBFile [.MDF]作为我的数据库,它存储在App_Data文件夹中。
在服务器中生成错误为它没有连接。
我的ConnectionString
I have develop a web application which is executing perfectly in my local machine.
I purchase a hosting from parallel Plesk. Where I had upload all my files.
I am using AttachDBFile [.MDF]as my database, which is store in App_Data Folder.
in the server its generating error as its is not connected.
My ConnectionString
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\DBASE.mdf;User Instance=true;MultipleActiveResultSets=true;" providerName="System.Data.SqlClient"/>
</connectionStrings>
错误:
Error:
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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
如果我使用以下代码
if I am using the following code
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="data source=123.123.123.123\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\DBASE.mdf;User Instance=true;MultipleActiveResultSets=true;" providerName="System.Data.SqlClient"/>
</connectionStrings>
Error:
Invalid value for key 'attachdbfilename'.
请帮助
为了安全起见因为我无法透露我的IP地址,我为此道歉。
请帮助我。
Please help
For security reason I am not able to disclose my IP Address, I apologized for that.
Please help me.
推荐答案
这篇关于连接字符串中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!