Skip to content

How do I add support to another ADO.Net client?

Zohar Peled edited this page Aug 17, 2017 · 2 revisions

If you want to add support to another client implementation (for instance, MySqlClient), you will need to do the following:

  1. Add a property for that client in the private struct DbTypeMap (in DBTypeConverter.cs file).
  2. Add an internal extension method to convert to that type in this class like ToDbType() (in DBTypeConverter.cs file).
  3. Add mapping to that type in the static constructor of DBTypeConverter (in DBTypeConverter.cs file). (this is going to be time consuming... don't say I didn't worn you!)
  4. Add a class inheriting the DBHelper class (like SQLDBHelper, OleDbDBHelper and OdbcDBHelper).
    In this class, override the virtual CreateParameter method, and you might also want to override the FillDataTable method.
  5. Add a value to the DataBaseType enum (in DBHelperFactory.cs file).
  6. Add a case for this new value inside the GetInstance method of the DBHelperFactory class (in DBHelperFactory.cs file).
Clone this wiki locally