After looking into different options one possible could be to use the c# dynamic keyword. It will allow us to get the required type at run time and it could fix the compilation erros. On the same lines we can use
ObjectHandle objObjectHandle = Activator.CreateInstance
to create the instance at runtime and can consume it using unwrap function .
Using Activator.CreateInstance to get the object type at runtime.
ObjectHandle objObjectHandle = Activator.CreateInstance("Npgsql","Npgsql.NpgsqlDataAdapter");
to use dynamic keyword it will be required to use Microsoft.CSharp.dll version 4 , add its reference in project file. Other solution we are looking at to create a Library project and make a standard object Model for both type of databases.