tailieunhanh - Connecting to a Named Instance of SQL Server or Microsoft Data Engine (MSDE)

[ Team LiB ] Recipe Connecting to a Named Instance of SQL Server or Microsoft Data Engine (MSDE) Problem You want to connect to a named instance of a SQL Server or Microsoft Data Engine (MSDE). Solution You need to understand what a SQL Server or MSDE named instance is and how to connect to one. | Team LiB Recipe Connecting to a Named Instance of SQL Server or Microsoft Data Engine MSDE Problem You want to connect to a named instance of a SQL Server or Microsoft Data Engine MSDE . Solution You need to understand what a SQL Server or MSDE named instance is and how to connect to one. The sample code contains a single event handler Connect Creates and opens a connection to a named instance of a SQL Server. Information about the SQL Server is displayed from the properties of the SqlConnection object. The C code is shown in Example 1-6. Example 1-6. File Namespaces variables and constants using System using using using using . . . private void connectButton_Click object sender e StringBuilder result new StringBuilder SqlConnection conn new SqlConnection Sql_Msde_ConnectString try Return some information about the server. ConnectionState DataSource ConnectionState ServerVersion catch Exception ex finally ConnectionState Discussion SQL Server 2000 introduced the ability to install multiple copies of SQL Server on a single computer. Only one copy can function as the default instance at any time it is identified by the network name of the computer on which it is running. All other copies are named instances and are identified by the network name of the computer plus an instance name. The format is computerName instanceName . This format is used in the connection string to specify the Data Source attribute for a named instance. Each instance operates independently of the other instances installed on the same computer. Each instance has its own

crossorigin="anonymous">
Đã 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.