Mimer SQL Data Provider
ConnectionString Property
Example 




Mimer.Data.Client Namespace > MimerConnection Class : ConnectionString Property
Gets or sets the string that defines the information needed to connect to a database server.
Syntax
'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.
Remarks
The following keywords are support by the Mimer Data Provider:
KeyWord Remarks
Database The name of the database server to connect to. You must always specify this keyword.
User ID The database user to connect to. The User Id is not used if Integrated Security is selected. Otherwise User Id is required.
Password The password for the User ID. Ignored if Integrated Security is used.
Integrated Security If set to true, the system will try to use the current Windows user to login. This type of login succeeds if there is an ident of type OS_USER with the same name as the Windows user. If keyword is not specified or set to false, User Id and Password is used to login to the database server.
Persist Security Info After successful login the password information is removed from the connection string unless this keyword is set to true.
Node The network node the database server is located on. For protocol tcp this is the TCP/IP node name or IP address.
Protocol The network protocol to use when communicating with the database server. Which protocols are supported are both platform and installation specific.

Protocol tcp, which gives both access to local and remote servers, is always supported. tcp may not be combined with the keyword Integrated security.

Protocol local is the most efficient protocol to use when communicating with a database server on the same machine or device. For the Crossfire environment this protocol is not yet supported. For the .NET Framework and Compact Framework a special library called mimcomm.dll must be accessible for the protocol to be used.

Protocol NamedPipes is currently only supported in the .NET environment. It allows secure network access and also allows IntegratedSecurity to be used over the network.

Service For protocol tcp this is the port number and for protocol NamedPipes this is the name of the database server.
Allowed Trace Level The level of tracing allowed on the connection. Level none prohibits tracing of the connection. Level safe allows tracing of library function calls and errors. Level confidential allows tracing of all information on the connection, including SQL statements, SQL parameters, and connection strings which may contain sensitive information.
Application Name The name of the application that the connection is associated with. This can be used to filter which connections are being traced.
Example

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()
Requirements

.NET Framework
Version 2.0 or later

See Also

Reference

MimerConnection Class
MimerConnection Members
MimerConnectionStringBuilder Class