打印本文 打印本文 关闭窗口 关闭窗口
第二课 SqlConnection对象(翻译)
作者:武汉SEO闵涛  文章来源:敏韬网  点击数11088  更新时间:2007/11/14 13:12:47  文章录入:mintao  责任编辑:mintao
SqlConnection conn = new SqlConnection(
    "Data Source=(local);Initial Catalog=Northwind;Integrated Security=SSPI");

The SqlConnection object instantiated above uses a constructor with a single argument of type string.  This argument is called a connection string.  Table 1 describes common parts of a connection string.

上面实例化SqlConnection对象使用了带一个string类型参数的构造函数。这个参数叫做连接字符串(connection string)。表1描述了连接字符串的通常部分。

Table 1.  ADO.NET Connection Strings contain certain key/value pairs for specifying how to make a data base connection.  They include the location, name of the database, and security credentials.

1.ADO.NET连接字符串包括某些键/值对来指示如何连接数据库。它们包括位置、数据库的名字、和安全认证。

Connection String Parameter Name

Description

Data Source

Identifies the server.  Could be local machine, machine domain name, or IP Address.

Initial Catalog

Data base name.

Integrated Security

Set to SSPI to make connection with user''''s Windows login

User ID

Name of user configured in SQL Server.

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  ...  下一页 >> 

打印本文 打印本文 关闭窗口 关闭窗口