To convert an existing ODBC application based on ADO.NET to the Mimer Data Provider you need to take the following steps:
Replace all occurrences of System.Data.Odbc with Mimer.Data.Client. This includes both using clauses and references that use full names.
Locate all references to OdbcType and decide how to map these. The table below gives guidelines for data type mapping.
Note Be sure that you locate and change all references from OdbcType.Timestamp to MimerDbType.VarBinary as there exists a type MimerDbType.Timestamp with another meaning than OdbcType.Timestamp.
Replace all object references with prefix Odbc to prefix Mimer, which is used by the Mimer Data Provider.
For example, change OdbcCommand to MimerCommand and so on.
In the ConnectionString property of the MimerConnection object, choose the desired Mimer Data Provider database. The Odbc connection string properties should be converted to the appropriate Mimer connection string properties.
Test your application thoroughly.
| OdbcType | Corresponding MimerDbType |
|---|---|
| BigInt
Exact numeric value with precision 19 (if signed) or 20 (if unsigned) and scale 0 (signed: –2[63] <= n <= 2[63] – 1, unsigned:0 <= n <= 2[64] – 1) (SQL_BIGINT). |
BigInt |
| Binary A stream of binary data (SQL_BINARY). |
VarBinary |
| Bit Single bit binary data (SQL_BIT). |
Boolean |
| Char A fixed-length character string (SQL_CHAR). |
Char |
| Date Date data in the format yyyymmdd (SQL_TYPE_DATE). |
Date |
| DateTime Date data in the format yyyymmddhhmmss (SQL_TYPE_TIMESTAMP). |
Timestamp |
| Decimal Signed, exact, numeric value with a precision of at least p and scale s, where 1 <= p <= 15 and s <= p (SQL_DECIMAL). |
Decimal |
| Double Signed, approximate, numeric value with a binary precision 53 (zero or absolute value 10[–308] to 10[308]) (SQL_DOUBLE). |
Double |
| Image Variable length binary data (SQL_LONGVARBINARY). |
Blob |
| Int Exact numeric value with precision 10 and scale 0 (signed: –2[31] <= n <= 2[31] – 1, unsigned:0 <= n <= 2[32] – 1) (SQL_INTEGER). |
Int |
| NChar Unicode character string of fixed string length (SQL_WCHAR). |
NChar |
| NText Unicode variable-length character data (SQL_WLONGVARCHAR). |
NClob |
| Numeric Signed, exact, numeric value with a precision p and scale s, where 1 <= p <= 15, and s <= p (SQL_NUMERIC). |
Decimal |
| NVarChar A variable-length stream of Unicode characters (SQL_WVARCHAR). |
NVarChar |
| Real Signed, approximate, numeric value with a binary precision 24 (zero or absolute value 10[–38] to 10[38]).(SQL_REAL). |
Real |
| SmallDateTime Data and time data in the format yyyymmddhhmmss (SQL_TYPE_TIMESTAMP). |
Timestamp |
| SmallInt Exact numeric value with precision 5 and scale 0 (signed: –32,768 <= n <= 32,767, unsigned: 0 <= n <= 65,535) (SQL_SMALLINT). |
SmallInt |
| Text Variable length character data (SQL_LONGVARCHAR). |
Clob |
| Time Date data in the format hhmmss (SQL_TYPE_TIME). |
Time |
| Timestamp A stream of binary data (SQL_BINARY). |
VarBinary |
| TinyInt Exact numeric value with precision 3 and scale 0 (signed: –128 <= n <= 127, unsigned:0 <= n <= 255) (SQL_TINYINT). |
SmallInt or DbType.SByte or DbType.Byte |
| UniqueIdentifier A fixed-length, globally unique identifier (GUID) (SQL_GUID). |
Guid |
| VarBinary Variable length binary. The maximum is set by the user (SQL_VARBINARY). |
VarBinary |
| VarChar A variable-length stream character string (SQL_CHAR). |
VarChar |
General guidelines for converting an application to the Mimer Data Provider | MimerDbType enumeration