To convert an existing SQL Server application based on ADO.NET to the Mimer SQL Data Provider you need to take the following steps:
Replace all occurrences of System.Data.SqlClient with Mimer.Data.Client. This includes both using clauses and references that use full names.
Data types in SQL Server use the enumeration SqlDbType. Change these to the MimerDbType enumeration instead. The table below shows a suggested mapping of data types.
Replace all object references with prefix Sql to prefix Mimer, which is used by the Mimer SQL Data Provider.
For example, change SqlCommand to MimerCommand and so on.
In the ConnectionString property of the MimerConnection object, choose the desired database. The SQL Server connection string properties should be converted to the appropriate Mimer connection string properties.
If you are using SQL Server specific data types in the namespace System.Data.SqlTypes you should convert these to the equivalent .NET framework data types instead. Pay specific attention to calls to SqlDataReader.GetValue and GetValues.
Test your application thoroughly.
SqlDbType | Corresponding MimerDbType |
---|---|
BigInt
A 64-bit signed integer. |
BigInt |
Binary
A fixed-length stream of binary data ranging between 1 and 8,000 bytes. |
VarBinary or DbType.Binary |
Bit
An unsigned numeric value that can be 0, 1, or a null reference (Nothing in Visual Basic). |
Boolean |
Char
A fixed-length stream of non-Unicode characters ranging between 1 and 8,000 characters. |
Char |
DateTime
Date and time data ranging in value from January 1, 1753 to December 31, 9999 to an accuracy of 3.33 milliseconds. |
Timestamp |
Decimal
A fixed precision and scale numeric value between -1038 -1 and 10 38 -1. |
Decimal |
Float
A floating point number within the range of -1.79E +308 through 1.79E +308. |
Double |
Image
A variable-length stream of binary data ranging from 0 to 231 -1 (or 2,147,483,647) bytes. |
Blob |
Int
A 32-bit signed integer. |
Int |
Money
A currency value ranging from -263 (or -922,337,203,685,477.5808) to 2 63 -1 (or +922,337,203,685,477.5807) with an accuracy to a ten-thousandth of a currency unit. |
Decimal |
NChar
A fixed-length stream of Unicode characters ranging between 1 and 4,000 characters. |
NChar |
NText
A variable-length stream of Unicode data with a maximum length of 230 - 1 (or 1,073,741,823) characters. |
NClob |
NVarChar
A variable-length stream of Unicode characters ranging between 1 and 4,000 characters. Note Implicit conversion fails if the string is greater than 4,000 characters. Explicitly set the object when working with strings longer than 4,000 characters. |
NVarChar |
Real
A floating point number within the range of -3.40E +38 through 3.40E +38. |
Real |
SmallDateTime
Date and time data ranging in value from January 1, 1900 to June 6, 2079 to an accuracy of one minute. |
Timestamp |
SmallInt
A 16-bit signed integer. |
SmallInt |
SmallMoney
A currency value ranging from -214,748.3648 to +214,748.3647 with an accuracy to a ten-thousandth of a currency unit. |
Decimal |
Text
A variable-length stream of non-Unicode data with a maximum length of 231 -1 (or 2,147,483,647) characters. |
Clob |
Timestamp
Automatically generated binary numbers, which are guaranteed to be unique within a database. timestamp is used typically as a mechanism for version-stamping table rows. The storage size is 8 bytes. |
Binary |
TinyInt
An 8-bit unsigned integer. |
SmallInt or DbType.Byte |
UniqueIdentifier
A globally unique identifier (or GUID). |
Guid |
VarBinary
A variable-length stream of binary data ranging between 1 and 8,000 bytes. Note Implicit conversion fails if the byte array is greater than 8,000 bytes. Explicitly set the object when working with byte arrays larger than 8,000 bytes. |
VarBinary |
VarChar
A variable-length stream of non-Unicode characters ranging between 1 and 8,000 characters. |
VarChar |
Variant
A special data type that can contain numeric, string, binary, or date data as well as the SQL Server values Empty and Null, which is assumed if no other type is declared. |
Object |