如何在VB.NET中连接到我的两个SQL Server版本之一 [英] How to connect to one of my two SQL server versions in VB.NET

查看:116
本文介绍了如何在VB.NET中连接到我的两个SQL Server版本之一的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的PC,2000和2012上安装了2个SQL Server版本,现在正尝试在2000版本上连接我的应用程序。为了支持使用MSSQL2000作为后端的旧系统,有必要使用它。我在连接字符串上使用了命名实例以及IP /端口地址,但由于找不到服务器,我仍然无法连接。任何能够指出我正确方向的人都将受到高度赞赏。在此先感谢:)



我的MSSQL 2012服务器:

Dim cn As SqlConnection = New SqlConnection(Data Source = CMSIMON \ MSSCT;初始目录= Northwind; User = sa;密码= August151984)



我的MSSQL 2000服务器:

Dim cn As SqlConnection =新的SqlConnection(数据源= CMSIMON \ MSSCT2000;初始目录= Northwind;用户= sa;密码= August151984)



2012工作正常,MSSQL 2000是没有。



我尝试了什么:



我使用了命名实例以及连接字符串上的IP /端口地址,但仍然无法连接,因为找不到服务器。

解决方案





查看此内容...



备份 - 同一开发机器上的多个版本的SQL Server ne - 数据库管理员堆栈交换 [ ^ ]



希望这会对你有所帮助。



干杯


如果找不到MS SQL Server,则必须检查SQL Server是否已正确安装和配置...



运行MS SSMS(Microsoft SQL Server Management Studio)并检查是否存在MS SQL Server实例(您正在尝试连接)。如果不存在,则必须正确配置它。

实例配置 [ ^ ]

创建新的注册服务器(SQL Server Management Studio) [ ^ ]

创建或删除客户端使用的服务器别名(SQL Server配置管理器) [ ^ ]

配置服务器以在备用管道上侦听(SQL Server配置管理器) [ ^ ]

配置服务器以侦听特定TCP端口(SQL Server配置管理器) [ ^ ]

创建或删除客户端使用的服务器别名(SQL Server配置管理器) [ ^ ]

为数据库引擎访问配置Windows防火墙 [ ^ ]



有关连接字符串的更多详细信息,请查看: SQL Server con连接字符串 - ConnectionStrings.com [ ^ ]

Hi, I have installed 2 SQL Server versions on my PC, 2000 and 2012, and is now trying to connect my application on the 2000 one. It is necessary in order to support legacy systems still beiung used that uses MSSQL2000 as backend. I used named instance as well as IP/Port address on the connection string but still I cannot connect as the server was not found. Any one of you who can point me to the right direction would be highly appreciated. Thanks in advance :)

for my MSSQL 2012 Server:
Dim cn As SqlConnection = New SqlConnection("Data Source = CMSIMON\MSSCT; Initial Catalog = Northwind; User = sa; Password = August151984")

for my MSSQL 2000 Server:
Dim cn As SqlConnection = New SqlConnection("Data Source = CMSIMON\MSSCT2000; Initial Catalog = Northwind; User = sa; Password = August151984")

2012 works fine, MSSQL 2000 is not.

What I have tried:

I used named instance as well as IP/Port address on the connection string but still I cannot connect as the server was not found.

解决方案

Hi,

Check this...

backup - Multiple versions of SQL Server on the same development machine - Database Administrators Stack Exchange[^]

Hope this will help you.

Cheers


If MS SQL Server couldn't be found, you have to check if the SQL Server is properly installed and configured...

Run MS SSMS (Microsoft SQL Server Management Studio) and check if the instance of MS SQL Server (you're trying to connect) exists. If doesn't exist, you have to properly configure it.
Instance Configuration[^]
Create a New Registered Server (SQL Server Management Studio)[^]
Create or Delete a Server Alias for Use by a Client (SQL Server Configuration Manager)[^]
Configure a Server to Listen on an Alternate Pipe (SQL Server Configuration Manager)[^]
Configure a Server to Listen on a Specific TCP Port (SQL Server Configuration Manager)[^]
Create or Delete a Server Alias for Use by a Client (SQL Server Configuration Manager)[^]
Configure a Windows Firewall for Database Engine Access[^]

For further details about connection string, check this: SQL Server connection strings - ConnectionStrings.com[^]


这篇关于如何在VB.NET中连接到我的两个SQL Server版本之一的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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