Using an IP Address to Connect to SQL Server

[ Team LiB ] Recipe Using an IP Address to Connect to SQL Server Problem You want to connect to a SQL Server using its IP address instead of its server name. Solution Use the Network Address and Network Library attributes of the connection string | Team LiB Recipe Using an IP Address to Connect to SQL Server Problem You want to connect to a SQL Server using its IP address instead of its server name. Solution Use the Network Address and Network Library attributes of the connection string. The sample code contains a single event handler Connect Creates and opens a connection to a SQL Server using its IP address. Information about the SQL Server is displayed from the properties of the SqlConnection object. The C code is shown in Example 1-5. Example 1-5. File Namespaces variables and constants using System using . . . private void connectButton_Click object sender e String connString Network Library dbmssocn Network Address Integrated security SSPI Initial Catalog Northwind SqlConnection conn new SqlConnection connString Return some information about the server. ConnectionState DataSource ServerVersion ConnectionState Discussion SQL Server network libraries are dynamic-link libraries DLLs that perform network operations required for client computers and SQL Server computers to communicate. A server can monitor multiple libraries simultaneously the only requirement is that each network library to be monitored is installed and configured. Available network libraries for SQL Server 2000 include AppleTalk ADSP Allows Apple Macintosh to communicate with SQL Server using native AppleTalk protocol. Banyan VINES Supports Banyan VINES Sequenced Packet Protocol SPP across Banyan VINES IP network protocol. Multiprotocol Automatically chooses the first available network protocol to establish a connection generally with performance comparable to using a native network library. TCP IP Sockets NWLink IPX SPX and Named Pipes are supported. Named Pipes .

Bấm vào đây để xem trước nội dung
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.