OleDbConnection::DataSource Property
Gets the server name or file name of the data source.
Assembly: System.Data (in System.Data.dll)
public: [BrowsableAttribute(true)] property String^ DataSource { virtual String^ get() override; }
Property Value
Type: System::String^The server name or file name of the data source. The default value is an empty string.
If the connection to the database is closed, the DataSource property returns whatever is contained in ConnectionString for the data source keyword. If the connection is open and the ConnectionString data source keyword's value starts with "|datadirectory|", the property returns whatever is contained in ConnectionString for the data source keyword only. If the connection to the database is open, the property returns what the native provider returns for the DBPROP_INIT_DATASOURCE, and if that is empty, the native provider’s DBPROP_DATASOURCENAME is returned.
The following example creates an OleDbConnection and displays some of its read-only properties.
Available since 1.1