How to remotely log on to the SQL Server 2014 Database: sql2014

Source: Internet
Author: User

How to remotely log on to the SQL Server 2014 Database: sql2014

Log on to the SQLServer (2014) database remotely for your reference. The details are as follows:

Two computers with the same IP address and CIDR Block in the same LAN

Configuration:

Computer1: Windows 10, Install SQL Server 2014 enterprise Edition (as a Server)

Computer2: Windows 10, VS2015

Computer1: (1) set two login Methods: Windows user authentication and SQL Server Authentication

(2) configure the SQL Server Configuration Manager

Set the network configuration to enable both the Named Pipes and TCP/IP protocols. The default TCP/IP Port Number is 1433.

The preceding two protocols are opened on the same client.

(3) server configurations above 05 (in version 05, the peripheral Configurator is enabled, and the Database Engine opens the remote connection in the service and connection configurator)

In SSMS, right-click the server user name and choose "server configuration"> "RemoteAccessEnabled" to "true ".

(4) re-enable the corresponding server and client services (set to automatic). The service will not be disabled when it is restarted.

(5) open port 1433 firewall-Advanced Settings-Inbound rules-New rules-Port-TCP-specific port (1433), and the remaining default listening port doscommand: netstat-

CumputerB: C # write A program to connect to the database of Computer a SQL Server

(1) Create an SQL project. Select SQL Server 2014 as the property project setting platform.

Debug-edit and set connection properties to connect successfully

(2) establish a C # console program and write code connection

// Add the namespace using System. data. sqlClient; // Connection database string cnnStr = "Server = DESKTOP-UE87L88; database = WorkshopData1; uid = sa; pwd = neopen"; // Server name, database name, user name, password myConnection = new SqlConnection (cnnStr); myConnection. open ();

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.