Gets or sets the string used to open a data store in SQL Server.
[Visual Basic] Overridable Public Property ConnectionString As String [C#] public string ConnectionString {override get; override set;} [C++] public: __property virtual String* get_ConnectionString(); public: __property virtual void set_ConnectionString(String*); [JScript] public function get ConnectionString() : String; public function set ConnectionString(String);
The connection string used to indicate the source database and other information used in establishing the initial connection. The default value is an empty string.
The string can only be set when the state of the connection is closed.
The following example creates a SQLConnection and sets some of its properties.
SQLConnection Class | SQLConnection Members | System.Data.SQL Namespace | ConnectionTimeout | Database | DataSource | UserID | Password | IsolationLevel