I have been trying create my own DbProvider and configure it with EnterpriseLibrary but I'm running through below issue
Parameter discovery is not supported for connections using GenericDatabase. You must specify the parameters explicitly, or configure the connection to use a type deriving from Database that supports parameter discovery.
I have Created Connection class which implements DbConnection and other classes like classes which implmenets DbCommand etc
I have overriden the DbConnection class and the methods which I dont know implementation I have thrown Not implemented exception like
public override string Database
{
get
{
throw new NotImpelmentedException();
}
}
And I have created enterpriselibrary connection as below
public Database GetConnection()
{
CustomDbProviderFactory obj = new CustomDbProviderFactory();
GenericDatabase db = new GenericDatabase("server=****;Request Timeout=3000000;", obj);
return db;
}
but when I execute DataReader with conection string and command I 'm getting issue I have mentioned
I have resolved this issue, While using generic database object , I was using like this
db.ExecuteReader("Select * from employees");
instead it should be
db.ExecuteReader(CommandType.Text,"Select * from employees");