asp.net.ph

SqlConnection Constructor

System.Data.SqlClient Namespace   SqlConnection Class


Initializes a new instance of the SqlConnection class.

Overload List

1. Initializes a new instance of the SqlConnection class.

2. Initializes a new instance of the SqlConnection class with the specified ConnectionString.


Example

The following example initializes and opens an SqlConnection with the given connection string.

NOTE: This example uses one of the overloaded versions of the SqlConnection constructor. For other examples that may be available, see the individual overload topics.

string connString = "user id=sa; password=yervzeñun;" +
   "initial catalog=northwind; data source=myServer";
SqlConnection myConn = new SqlConnection ( connString );
myConn.Open ( );
  C# VB

See Also

SqlConnection Members   ConnectionString   Connecting to a Database Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph