Gets or sets the name of the database to connect to.
[Visual Basic] Public Property DataSource As String [C#] public string DataSource {get; set;} [C++] public: __property String* get_DataSource(); public: __property void set_DataSource(String*); [JScript] public function get DataSource() : String; public function set DataSource(String);
The name of the database to connect to. The default value is an empty string.
The DataSource property overwrites the cooresponding property within the connection string.
Note This property is read-only while the connection is open.
The following example shows how to create a connection and set many of its properties.
ADOConnection Class | ADOConnection Members | System.Data.ADO Namespace | ConnectionTimeout | Database | IsolationLevel | ConnectionString | UserID | Password