Home Database Mysql Tutorial .NET 中SQL Server 2000、SQL Server 2005 连接字符串

.NET 中SQL Server 2000、SQL Server 2005 连接字符串

Jun 07, 2016 pm 03:08 PM
.net server sql connect

摘要: SQL Server 2005和SQL Server 2000在数据库访问上面是通用的,关键在一个 连接 串的配置,其实这两个数据的 连接 串是可以通用的,关键是数据库服务器地址的问题。SQL Server 2005和2000数据库默认访问端口不一样。2005是2317,2000的是1433。 微软的

摘要:SQL Server 2005和SQL Server 2000在数据库访问上面是通用的,关键在一个连接串的配置,其实这两个数据的连接串是可以通用的,关键是数据库服务器地址的问题。SQL Server 2005和2000数据库默认访问端口不一样。2005是2317,2000的是1433。

 

 

微软的SQL Server 2005和SQL Server 2000在数据库访问上面是通用的,关键在一个连接串的配置,其实这两个数据的连接串是可以通用的,关键是数据库服务器地址的问题。SQL Server 2005和2000数据库默认访问端口不一样。2005是2317,2000的是1433。下面四个连接串都可以访问2000。   
 
Server=myServerAddress;Database=DatabaseName;Uid=UserName;Pwd=Password;  
Data Source=myServerAddress;Initial Catalog=DatabaseName;User ID=UserName;pwd=Password;  
Server=myServerAddress,1433;Database=DatabaseName;Uid=UserName;Pwd=Password;  
Data Source=myServerAddress,1433;Initial Catalog=DatabaseName;User ID=UserName;pwd=Password;   

 
myServerAddress是数据库服务器地址,当您只写地址不写端口的情况下他们默认访问的是1433端口,也就是sqlserver 2000的数据库服务器。如果你想访问sqlserver 2005你就必须加上访问端口(,2317)或者在后面添加(\SQLExpress),如下面   
 
Server=myServerAddress,2317;Database=DatabaseName;Uid=UserName;Pwd=Password;  
Data Source=myServerAddress,2317;Initial Catalog=DatabaseName;User ID=UserName;pwd=Password;  
Server=myServerAddress\SQLExpress;Database=DatabaseName;Uid=UserName;Pwd=Password;  
Data Source=myServerAddress\SQLExpress;Initial Catalog=DatabaseName;User ID=UserName;pwd=Password; 
  
 
通过对比你就会发现,这里面的关键部分就是端口, 只要端口对了就任何问题,至于他们的访问形式和方法是完全一样,因为他们虽然不是双胞胎但也是亲兄弟,沟通方式一样,唯一的就是名字不一样。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What is the difference between HQL and SQL in Hibernate framework? What is the difference between HQL and SQL in Hibernate framework? Apr 17, 2024 pm 02:57 PM

HQL and SQL are compared in the Hibernate framework: HQL (1. Object-oriented syntax, 2. Database-independent queries, 3. Type safety), while SQL directly operates the database (1. Database-independent standards, 2. Complex executable queries and data manipulation).

How to connect keep body fat scale How to connect keep body fat scale Mar 07, 2024 pm 04:50 PM

How to connect the keep body fat scale? Keep has a specially designed body fat scale, but most users do not know how to connect the keep body fat scale. Next is the graphic tutorial on the connection method of the keep body fat scale that the editor brings to users. , interested users come and take a look! How to connect the keep body fat scale 1. First open the keep software, go to the main page, click [My] in the lower right corner, and select [Smart Hardware]; 2. Then on the My Smart Devices page, click the [Add Device] button in the middle; 3 , then select the device you want to add interface, select [Smart Body Fat/Weight Scale]; 4. Then on the device model selection page, click the [keep body fat scale] option; 5. Finally, in the interface shown below, finally [Add Now] at the bottom

Usage of division operation in Oracle SQL Usage of division operation in Oracle SQL Mar 10, 2024 pm 03:06 PM

"Usage of Division Operation in OracleSQL" In OracleSQL, division operation is one of the common mathematical operations. During data query and processing, division operations can help us calculate the ratio between fields or derive the logical relationship between specific values. This article will introduce the usage of division operation in OracleSQL and provide specific code examples. 1. Two ways of division operations in OracleSQL In OracleSQL, division operations can be performed in two different ways.

Comparison and differences of SQL syntax between Oracle and DB2 Comparison and differences of SQL syntax between Oracle and DB2 Mar 11, 2024 pm 12:09 PM

Oracle and DB2 are two commonly used relational database management systems, each of which has its own unique SQL syntax and characteristics. This article will compare and differ between the SQL syntax of Oracle and DB2, and provide specific code examples. Database connection In Oracle, use the following statement to connect to the database: CONNECTusername/password@database. In DB2, the statement to connect to the database is as follows: CONNECTTOdataba

Detailed explanation of the Set tag function in MyBatis dynamic SQL tags Detailed explanation of the Set tag function in MyBatis dynamic SQL tags Feb 26, 2024 pm 07:48 PM

Interpretation of MyBatis dynamic SQL tags: Detailed explanation of Set tag usage MyBatis is an excellent persistence layer framework. It provides a wealth of dynamic SQL tags and can flexibly construct database operation statements. Among them, the Set tag is used to generate the SET clause in the UPDATE statement, which is very commonly used in update operations. This article will explain in detail the usage of the Set tag in MyBatis and demonstrate its functionality through specific code examples. What is Set tag Set tag is used in MyBati

Three Ways to Fix Edge Your Connection Isn't Private Three Ways to Fix Edge Your Connection Isn't Private Mar 13, 2024 pm 01:30 PM

When you use the Edge browser to access web pages, have you ever encountered a prompt that your connection is not a dedicated connection, causing web browsing to fail? How is this going? Many friends don’t know how to deal with this problem. You can take a look at the following three solutions. Method 1 (simple and crude): In the edge browser, you can try to solve the problem of the website being inaccessible by entering the settings and turning off the security function, and then blocking location permissions in the website permissions. It is important to note that the effectiveness and duration of this approach may vary, and specific effects cannot be determined. After restarting your browser, you can try visiting the website to see if the issue is resolved. Method 2: Adjust the keyboard to English input

How to install, uninstall, and reset Windows server backup How to install, uninstall, and reset Windows server backup Mar 06, 2024 am 10:37 AM

WindowsServerBackup is a function that comes with the WindowsServer operating system, designed to help users protect important data and system configurations, and provide complete backup and recovery solutions for small, medium and enterprise-level enterprises. Only users running Server2022 and higher can use this feature. In this article, we will explain how to install, uninstall or reset WindowsServerBackup. How to Reset Windows Server Backup If you are experiencing problems with your server backup, the backup is taking too long, or you are unable to access stored files, then you may consider resetting your Windows Server backup settings. To reset Windows

How to connect OnePlus watch to Bluetooth headset_How to connect OnePlus watch to Bluetooth headset How to connect OnePlus watch to Bluetooth headset_How to connect OnePlus watch to Bluetooth headset Mar 23, 2024 pm 01:16 PM

1. Place the earphones in the earphone box and keep the lid open. Press and hold the button on the box to enter the pairing state of the earphones. 2. Turn on the watch music function and select Bluetooth headphones, or select Bluetooth headphones in the watch settings function. 3. Select the headset on the watch to pair successfully.

See all articles