Wednesday, May 6, 2009

Explain Connection Object

The Connection object creates the connection to the database. Microsoft Visual Studio .NET provides two types of Connection classes: the SqlConnection object, which is designed specifically to connect to Microsoft SQL Server 7.0 or later, and the OleDbConnection object, which can provide connections to a wide range of database types like Microsoft Access and Oracle. The Connection object contains all of the information required to open a connection to the database.

The connection helps identify the data base server, the data base name, user name, password, and other parameters that are required for connecting to the data base.

Example:

SqlConnection conn = new SqlConnection( "Data Source=(local);Initial Catalog=xyz;Integrated Security=SSPI");

No comments:

Post a Comment