将LINQPad连接到远程SQL Server [英] Connect LINQPad to remote SQL Server
问题描述
免责声明:我知道这个问题非常基本,但是我无法在Google或此处找到答案,而且我自己也无法通过猜测的配置来做到这一点.
Disclaimer: I understand the question is very basic, but I could not find the answer in Google or here, and can not do it myself with guessed configuration.
我想开始使用LINQPad,并且在同一域的不同计算机上安装了SQL Server 2005.但是我无法从LINQPad连接到该服务器.
I want to get started with LINQPad and I have a SQL Server 2005 installed on different machine in the same domain. But I can not connect to that server from LINQPad.
这是屏幕截图:
我应该把什么作为服务器字符串?
What do I put as a Server string?
非常感谢!
更新1: SERVERNAME\MSSQLSERVER
确实有所作为.代替错误
Update 1: SERVERNAME\MSSQLSERVER
does make a difference. Instead of Error
26(找不到服务器实例)
26 (Can not find server instance)
我收到错误
25(连接字符串不正确)
25 (Connection string is not correct)
我尝试了2种不同的SQL Server:生产服务器上的SQL 2005和本地计算机上的Sql Server 2008 R2,我尝试了Windows身份验证和SQL身份验证.它没有区别.
但是我可以使用Windows和SQL Server身份验证通过MS SQL Server Management Studio连接到这两个服务器(2005和2008).这不是SQL Server权限问题-我尝试了SA
用户进行连接.它适用于 sqlservermanagestudio 的问题,但不适用于LINQPad.
I have tried 2 different SQL Servers: SQL 2005 on production server and Sql Server 2008 R2 on local machine, I have tried windows authentication and SQL authentication. And it makes no difference.
But I can connect to both server (2005 and 2008) with MS SQL Server Management Studio with Windows and SQL server authentication. And it's not SQL Server permission issue - I have tried SA
user to connect. It works with sqlservermanagementstudio, but not with LINQPad.
有什么建议吗?我需要更改SQL Server上的设置吗?
Any advice? Is there a setting on SQL Server I need to change?
更新2:我找到了解决问题的方法.
我必须在不指定SQLEXPRESS
或MSSQLSERVER
的情况下将SERVERNAME\
放入服务器"字段.
不是很直观=(
Update 2: I found the solution to the problem.
Into Server field I had to put SERVERNAME\
without specifying SQLEXPRESS
or MSSQLSERVER
.
Not very intuitive =(
推荐答案
我找到了解决问题的方法. 在服务器"字段中,我必须输入"SERVERNAME \",而无需任何SQLEXPRESS或MSSQLSERVER. 就像@sgmoore指出的那样,我只要键入"LOCALHOST"或"SERVERNAME",它就连接了. 显然,这是SQL Server的功能/错误,与LINQPad无关.
I found the solution to the problem. Into Server field I had to put "SERVERNAME\" without any SQLEXPRESS or MSSQLSERVER. Also as pointed out by @sgmoore, I could just type "LOCALHOST" or "SERVERNAME" and it connected. Apparently this is SQL Server feature/bug, nothing to do with LINQPad.
UPD ,您也可以使用."表示本地主机"
UPD You can also use "." to denote "localhost"
这篇关于将LINQPad连接到远程SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!