远程SQL Server 2008中的连接字符串没有SQL Management Studio中 [英] Connection string for remote SQL server 2008 without SQL Management Studio
问题描述
我知道它的一个经典问题,但我太新手,甚至融为一体prehend的基本知识(对不起)。我有这个ASP.NET网站与数据库(SQL Server 2008中),而我试图到远程主机服务器(HostGator的)VS 2010中使用网站复制工具上部署
在VS 2010中,我可以直接通过该数据库,这竟然是财产抢连接字符串
数据
源= \\ SQLEX $ P $干燥综合征; AttachDbFilename =C:\\用户\\ MYNAME \\文档\\ Visual
Studio 2010的\\网站已\\实验\\ App_Data文件\\ data.mdf综合
安全=真;用户实例=真
块引用>现在,我知道,叫一个网站 http://connectionstrings.com/ 存在,但其过于庞大的我第一眼。
我现在的连接字符串:
数据
Source=domainName.com\\SQLEX$p$pSS;AttachDbFilename=C:\\inetpub\\vhosts\\domainName\\httpdocs\\Experiment\\App_Data\\data.mdf;Integrated
安全=真;用户实例=真
块引用>我是pretty肯定,认为这是错误的,因为它给我的经典错误:
发生-特定实例的网络相关的或错误而
与SQL Server建立连接。
块引用>但我不知道如何解决它。从哪里开始寻找,如何启动,如何去构建连接字符串所需的参数。如何找到的路径
AttachDbFilename
?可以请你帮忙吗?我相信,连接字符串是需要修改的唯一参数。如果有别的东西,然后请建议?另外,我一直在整个SQL Management Studio中的使用情况来做出工作上的事情,我没有这一点,所以是很难做到这一点没有它?
请帮忙,谢谢。
解决方案您不能指定相对于你自己的机器的目录。
更改AttachDbFilename到AttachDbFilename = | DataDirectory目录| data.mdf
为
数据源中的具体
应该从你的托管公司,以及安全模型(可能你需要使用一个特定的用户)可以给你。您可以从下载SqlServer的管理工作室前preSS此链接
I know its a classic problem, but I am too novice to even comprehend the basics (sorry). I have this ASP.NET "Website" with databases (SQL Server 2008), which I am trying to deploy on a Remote Host Server (HostGator) using WebSite Copy tool of VS 2010.
In VS 2010, I could grab the Connection string directly through the "property" of the database, which turned out to be:
Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Users\myName\Documents\Visual Studio 2010\WebSites\Experiment\App_Data\data.mdf";Integrated Security=True;User Instance=True
Now, I know that a website called http://connectionstrings.com/ exists, but its too overwhelming for me at first glance.
My current connection string:
Data Source=domainName.com\SQLEXPRESS;AttachDbFilename=C:\inetpub\vhosts\domainName\httpdocs\Experiment\App_Data\data.mdf;Integrated Security=True;User Instance=True
I am pretty sure, that this is wrong as its giving me the classic error of:
A network-related or instance-specific error occurred while establishing a connection to SQL Server..
But I don't know how to fix it. Where to start looking, how to initiate, how to get the parameters required to build the connection string. How to find the path of the
AttachDbFilename
? Can you please help?I believe, that connection string is the only parameter which needs to be modified. If there's something else, then please suggest? Also, I keep coming across the usage of SQL Management Studio to make things work, I don't have that, so is it hard to accomplish this without it?
Please help, thanks.
解决方案You can't specify a directory relative to your own machine. Change AttachDbFilename to
AttachDbFilename=|DataDirectory|data.mdf
The specifics for
Data Source
should be given to you from your hosting company, as well the security model (probably you need to use a specific user)You can download SqlServer Management Studio Express from this link
这篇关于远程SQL Server 2008中的连接字符串没有SQL Management Studio中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!