Gets or sets the user ID to use when connecting.
[Visual Basic] Public Property UserID As String [C#] public string UserID {get; set;} [C++] public: __property String* get_UserID(); public: __property void set_UserID(String*); [JScript] public function get UserID() : String; public function set UserID(String);
The user ID to use when connecting. The default value is an empty string.
Exception Type | Condition |
---|---|
OpenConVariable | The connection is open. You must first close the connection. |
BrokenConError | The connection is broken. |
The UserID property overwrites the cooresponding property within the connection string.
Note This property is read-only while the connection is open.
The following example creates a SQLConnection and sets some of its properties.
SQLConnection Class | SQLConnection Members | System.Data.SQL Namespace | ConnectionString | ConnectionTimeout | Database | DataSource | Password | IsolationLevel