Mimer SQL Data Provider
MimerConnectionStringBuilder Class
Members  Example 




Mimer.Data.Client Namespace : MimerConnectionStringBuilder Class
This class is used to construct connection strings for the ConnectionString property.
Object Model
MimerConnectionStringBuilder Class
Syntax
'Declaration
 
Public NotInheritable Class MimerConnectionStringBuilder 
   Inherits System.Data.Common.DbConnectionStringBuilder
public sealed class MimerConnectionStringBuilder : System.Data.Common.DbConnectionStringBuilder 
public class MimerConnectionStringBuilder = class(System.Data.Common.DbConnectionStringBuilder)sealed; 
public sealed class MimerConnectionStringBuilder extends System.Data.Common.DbConnectionStringBuilder
public __gc __sealed class MimerConnectionStringBuilder : public System.Data.Common.DbConnectionStringBuilder 
Remarks
This class supports the following keywords:
Keyword
Database
User ID
Password
Integrated Security
Persist Security Info
Node
Protocol
Service
Allowed Trace Level
Application Name
For an explanation of each please see the ConnectionString documentation.
Example
The following examples creates a connection string with the following content: "Database=TESTDB;Protocol=tcp;Node=ExServer;User ID=TEST;Password=Testpass;Persist Security Info=false".
// 
// Style using the properties in the MimerConnectionStringBuilder class.
// 
MimerConnectionStringBuilder csb1 = new MimerConnectionStringBuilder();
csb1.Database = "TESTDB";
csb1.Protocol = "tcp";
csb1.Node = "ExServer";
csb1.UserId = "TEST";
csb1.Password = "Testpass";
csb1.PersistSecurityInfo = false;
// 
//  Same connection string using keywords and Add.
// 
MimerConnectionStringBuilder csb2 = new MimerConnectionStringBuilder();
csb2.Add("Database", "TESTDB");
csb2.Add("Protocol", "tcp");
csb2.Add("Node", "ExServer");
csb2.Add("User Id", "TEST");
csb2.Add("Password", "Testpass");
csb2.Add("Persist Security Info", false);
// 
//  Finally using the indexer built into the class.
// 
MimerConnectionStringBuilder csb3 = new MimerConnectionStringBuilder();
csb3["Database"] = "TESTDB";
csb3["Protocol"] = "tcp";
csb3["Node"] = "ExServer";
csb3["UserId"] = "TEST";
csb3["Password"] = "Testpass";
csb3["Persist Security Info"] = false;
// 
//  Here we use the connection string with the MimerConnection class.
// 
MimerConnection connection = new MimerConnection();
connection.ConnectionString = csb1.ToString();
connection.Open();
'
'  Style using the properties in the MimerConnectionStringBuilder class.
'
Dim csb1 As New MimerConnectionStringBuilder
csb1.Database = "TESTDB"
csb1.Protocol = "tcp"
csb1.Node = "ExServer"
csb1.UserId = "TEST"
csb1.Password = "Testpass"
csb1.PersistSecurityInfo = False
'
'  Same connection string using keywords and Add.
'
Dim csb2 As New MimerConnectionStringBuilder
csb2.Add("Database", "TESTDB")
csb2.Add("Protocol", "tcp")
csb2.Add("Node", "ExServer")
csb2.Add("User Id", "TEST")
csb2.Add("Password", "Testpass")
csb2.Add("Persist Security Info", False)
'
'  Finally using the indexer built into the class.
'
Dim csb3 As New MimerConnectionStringBuilder
csb3.Item("Database) = "TESTDB"
csb3.Item("Protocol) = "tcp"
csb3.Item("Node) = "ExServer"
csb3.Item("UserId) = "TEST"
csb3.Item("Password) = "Testpass"
csb3.Item("Persist Security Info") = False
'
'  Here we use the connection string with the MimerConnection class.
'
Dim connection As New MimerConnection
connection.ConnectionString = csb1.ToString()
connection.Open()
Inheritance Hierarchy

System.Object
   System.Data.Common.DbConnectionStringBuilder
      Mimer.Data.Client.MimerConnectionStringBuilder

Requirements

.NET Framework
Version 2.0 or later

See Also

Reference

MimerConnectionStringBuilder Members
Mimer.Data.Client Namespace