连接字符串中的问题 [英] problem in connectionstring

查看:74
本文介绍了连接字符串中的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个在我的本地机器上完美执行的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.

推荐答案

如果是l ocal sql express,语法正确,假设服务器实例名称是SQLEXPRESS,并且所有其他参数都是正确的。但是你确定,这些也适用于提供商吗?

我建议你咨询服务提供商,获取正确的连接字符串,并查阅语法库:http://www.connectionstrings.com/sql-server-2005 [ ^ ]
In case of local sql express, the syntax is correct, assuming that the server instance name is SQLEXPRESS, and all other parameters are correct. But are you sure, that those stand also for the provider also?
I suggest you consult with the service provider, to get the correct connection string, and consult the syntax gallery also: http://www.connectionstrings.com/sql-server-2005[^]


这篇关于连接字符串中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆