Gets or sets the string that defines the information needed to connect to a database server.
'Declaration
Public Overrides NotOverridable Property ConnectionString As String
public override string ConnectionString {get; set;}
public read-write property ConnectionString: String; override;
public override function get,set ConnectionString : String
public: __property string* get_ConnectionString() override;
public: __property void set_ConnectionString(
string* value
) override;
Property Value
The connection string that includes the parameters needed to establish the initial connection. Please note that Database must be specified. The default value is an empty string.
The following example logs in to a database server on another node in the network. The user TEST must be defined in the database server (done with the SQL command CREATE IDENT).
The following example logs in as the current operating system user in the database server.
No example is available for C++ or JScript. To view a C# example, click the Language Filter button in the upper-left corner of the page.
MimerConnection connection = new MimerConnection();
//
// Login as the Mimer ident TEST in the database server ExampleDB located on
// node ExServer using the TCP/IP network protocol
//
connection.ConnectionString = "Database=TESTDB;Protocol=tcp;Node=ExServer;" +
"User ID=TEST;Password=Testpass";
connection.Open();
try {
//
// Do something with the connection...
//
} finally {
//
// Always close the connection before the connection object goes out of scope
//
connection.Close();
}
Dim connection As New MimerConnection
'
' Login as the Mimer ident TEST in the database server ExampleDB located on
' node ExServer using the TCP/IP network protocol
'
connection.ConnectionString = "Database=TESTDB;Protocol=tcp;Node=ExServer;" &
"User ID=TEST;Password=Testpass"
connection.Open()
Try
'
' Do something with the connection...
'
Finally
'
' Always close the connection before the connection object goes out of scope
'
connection.Close()
End Try
MimerConnection connection = new MimerConnection();
//
// Login as the current Windows user in the local database server ExampleDB
//
connection.ConnectionString = "Database=ExampleDB;Integrated Security=true;Protocol=local";
connection.Open();
Dim connection as New MimerConnection
'
' Login as the current Windows user in the local database server ExampleDB
'
connection.ConnectionString = "Database=ExampleDB;Integrated Security=true;Protocol=local"
connection.Open()
.NET Framework
Version 2.0 or later