Mimer SQL Data Provider
How to convert from ODBC
Mimer SQL Data Provider > Overview > Converting an application to Mimer SQL Data Provider > How to convert from ODBC

To convert an existing ODBC application based on ADO.NET to the Mimer SQL Data Provider you need to take the following steps:

  1. Replace all occurrences of System.Data.Odbc with Mimer.Data.Client. This includes both using clauses and references that use full names.

  2. 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.
  3. Replace all object references with prefix Odbc to prefix Mimer, which is used by the Mimer SQL Data Provider.

    For example, change OdbcCommand to MimerCommand and so on.

  4. Recompile your application. When you recompile the application you may discover that there are ODBC specific functions that are used by the application. You must consider how to handle these.
  5. In the ConnectionString property of the MimerConnection object, choose the desired Mimer SQL Data Provider database. The Odbc connection string properties should be converted to the appropriate Mimer connection string properties.

  6. 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
See Also

Reference