Adapting wildcard characters to DBMS/Connections in .Net

A developper in my company has developped a C# project containing classes to execute SQL queries on the following DBMS :

  • Access (A DB file with the extension ".mdb") by using one of the following connections :
    • An ODBC connection.
    • An OLE DB connection
  • Access (A DB file with the extension ".accdb" extension) by using one of the following connections :
    • An ODBC connection.
    • An OLE DB connection.
  • DB2 by using an ODBC connection.
  • MySQL by using one of the following connections :
    • An ADO .Net connection.
    • An ODBC connection.
    • An OLE DB connection.
  • Oracle by using one of the following connections :
    • An ADO .Net connection.
    • An ODBC connection.
    • An OLE DB connection.
  • PostgreSQL by using one of the following connections :
    • An ADO .Net connection.
    • An ODBC connection.
  • SQL Server by using one of the following connections :
    • An ADO .Net connection.
    • An ODBC connection.
    • An OLE DB connection.

I want to implement a method that will be used to adapt wildcard characters in a string used in a predicate of a SQL query. Then the SQL query will be executed. When a developper needs to use wildcard characters then he will use a known character independant from DBMS.

Wildcard characters can differ from DBMS. Examples :

  • The wildcard character used by Access is '*'.
  • The wildcard character used by SQL Server is '%'.

But I wonder if the wildcard character also depends on the connection used to communicate with the DBMS. The wildcard character used by an ODBC connection could be different from the wildcard character used by an ADO .Net connection. I have not been able to perform a test on each pair of DBMS/Connection listed above because I cannot use some DBMS.

Answers


I have executed programmatically select queries for each pair of (DBMS/Data provider) listed in my first post except for the pair (DB2/ODBC). I have included a predicate in the where statement of my select query. I have used the multi-character wildcard character : % The wildcard character '%' works for each pair of (DBMS/Data provider) on which I have performed the test.


Need Your Help

Gitolite setup: unable to login with ssh key

ssh centos gitolite

I am trying to setup Gitlab on my server (Centos 6.3) and facing some problems with Gitolite setup.

index and search log files using Lucene - to function as grep?

regex apache search lucene indexing

There are plain txt log files within directory C:\logs. Now we want to index those log files, and then search the index using regex. My code is below. It searched using keyword "Unknown error". But...