This class is used to connect and disconnect from a database server.
For a list of all members of this type, see MimerConnection Members.
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
Mimer.Data.Client.MimerConnection
[Visual Basic] NotInheritable Public Class MimerConnection Inherits Component Implements IDbConnection, ICloneable [C#] public sealed class MimerConnection : Component, IDbConnection, ICloneable [C++] public __gc __sealed class MimerConnection : public Component, IDbConnection, ICloneable [JScript] public class MimerConnection extends Component, IDbConnection, ICloneable
Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
To open a connection to a database server, create an instance of the MimerConnection class, set the ConnectionString and then call the Open method. Make sure you explicitly Close the connection before the MimerConnection object goes out of scope. Otherwise there will be open connections in the database server until the object is garbage collected.
[C#]
MimerConnection connection = new MimerConnection();
//
// Open a connection to the database server ExampleDB on the same node (local) as the client
//
connection.ConnectionString = "Database=ExampleDB;Protocol=local;User Id=MIMER_STORE;Password=GoodiesAreUs";
try {
connection.Open();
//
// Insert a row into the table TABLE23
//
MimerCommand command = new MimerCommand("INSERT INTO TABLE23 VALUES('123',10)", connection);
command.ExecuteNonQuery();
} finally {
if (connection.State != ConnectionState.Closed) {
connection.Close();
}
}
[Visual Basic]
Dim connection As New MimerConnection
'
' Open a connection to the database server ExampleDB on the same node (local) as the client
'
connection.ConnectionString = "Database=ExampleDB;Protocol=local;User Id=MIMER_STORE;Password=GoodiesAreUs"
Try
connection.Open()
'
' Insert a row into the table TABLE23
'
Dim command As New MimerCommand("INSERT INTO TABLE23 VALUES('123',10)", connection)
command.ExecuteNonQuery()
Finally
If Not connection.State = ConnectionState.Closed Then
connection.Close()
End If
End Try
[C++, JScript] No example is available for C++, JScript or Visual Basic. To view a C# example, click the Language Filter button in the upper-left corner of the page.
Namespace: Mimer.Data.Client
Assembly: Mimer.Data.Client (in Mimer.Data.Client.dll)
MimerConnection Members | Mimer.Data.Client Namespace