将LINQPad连接到远程SQL服务器 [英] Connect LINQPad to remote SQL Sever

查看:265
本文介绍了将LINQPad连接到远程SQL服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

免责声明:我理解这个问题非常基本,但我在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.

这是屏幕截图:

Here is the screenshot:

我将什么作为服务器字符串?

What do I put as a Server string?

提前非常感谢!

更新1: SERVERNAME\MSSQLSERVER 确实有所作为。


26(找不到服务器实例)

26 (Can not find server instance)

我收到错误


25(连接字符串不正确)

25 (Connection string is not correct)

我试过2个不同的SQL服务器:生产服务器上的SQL 2005和本地机器上的Sql Server 2008 R2,我尝试了Windows身份验证和SQL身份验证。它没有什么区别。
但是我可以连接到服务器(2005和2008)与MS SQL Server Management Studio与Windows和SQL服务器身份验证。它不是SQL Server权限问题 - 我试过 SA 用户连接。它适用于 sqlservermanagementstudio ,但不适用于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 中指定 SERVERNAME\ MSSQLSERVER

不太直观=(

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 。表示localhost

UPD You can also use "." to denote "localhost"

这篇关于将LINQPad连接到远程SQL服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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