NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

SQLConnection Constructor (String)

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
);

Parameters

connectionString
The connection used to open the SQL Server data store.

Exceptions

Exception Type Condition
Exception The connection could not be mapped.

Remarks

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.

Example

The following example creates a SQLConnection and sets some of its properties.

See Also

SQLConnection Class | SQLConnection Members | System.Data.SQL Namespace | SQLConnection Constructor Overload List