Initializes a new instance of the SQLConnection class when given a string containing the connection text.
[Visual Basic] Overloads Public Sub New( _ ByVal connectionString As String _ ) [C#] public SQLConnection( string connectionString ); [C++] public: SQLConnection( String* connectionString ); [JScript] public function SQLConnection( connectionString : String );
Exception Type | Condition |
---|---|
Exception | The connection could not be mapped. |
When an instance of SQLConnection is created, the following read/write properties are set to initial values.
Properties | Initial Value |
---|---|
ConnectionString | connectionString |
ConnectionTimeout | 15 |
Database | empty string ("") |
IsolationLevel | Unspecified |
DataSource | empty string ("") |
UserID | empty string ("") |
Password | empty string ("") |
You can change the value for any of these properties through a separate call to the property.
The following example creates a SQLConnection and sets some of its properties.
SQLConnection Class | SQLConnection Members | System.Data.SQL Namespace | SQLConnection Constructor Overload List