The database type "Microsoft.Practices.EnterpriseLibrary.Data.GenericDatabase" does not support automatic parameter discovery. Use an IParameterMapper instead.

Topics: Data Access Application Block
May 7, 2014 at 7:34 PM
Edited May 7, 2014 at 7:35 PM
I had this code working and connecting to a sql server DB with the database credentials in the connection string. Then we changed our sql server and with the new server we are using integrated security and the database credentials are no longer in the connection string in web.cofing file. They have moved to the app pool on IIS. With the new server and setting, the app still connects to the database, but it throws the below error message. This frustrating. Do I really need to re-write my code? Or can this be fixed by changing some settings in the web.cofig files?

List<MyObject> results = new List<MyObject>();
        Database db = DatabaseFactory.CreateDatabase("MyDB");
        IRowMapper<ProgramAccessVM> mapper = MapBuilder<MyObject>.BuildAllProperties();
        var accessor = db.CreateSprocAccessor("proc_GetProgramAccess", mapper);
        var registeredWebconfs = accessor.Execute(organizationID);
        var result = from regWebconf in registeredWebconfs
                     select regWebconf;
        return result.ToList();
The database type "Microsoft.Practices.EnterpriseLibrary.Data.GenericDatabase" does not support automatic parameter discovery. Use an IParameterMapper instead.
May 9, 2014 at 12:39 PM
Can you post the configuration that is being used? It sounds like the database "MyDB" is not being recognized as a SqlDatabase so a GenericDatabase is being used instead. And, as the message says, GenericDatabases don't support parameter discovery.

~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to
May 28, 2014 at 3:28 PM
Edited May 28, 2014 at 3:40 PM
randylevy wrote:
Can you post the configuration that is being used? It sounds like the database "MyDB" is not being recognized as a SqlDatabase so a GenericDatabase is being used instead. And, as the message says, GenericDatabases don't support parameter discovery.

~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to
I have the same issue, "MyDb" is an Oracle Database and I'm using the provider: Oracle.DataAccess.Client. it creates a database of type "Microsoft.Practices.EnterpriseLibrary.Data.GenericDatabase".
<add name="ORCLCONN" connectionString="DATA SOURCE=TEST_SERV;USER ID=MYUSER;PASSWORD=****"
      providerName="Oracle.DataAccess.Client" />
When I use System.Data.OracleClient works, and it generates a database of type: "Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase"



System.Data.OracleClient is deprecated.

Thanks.
May 29, 2014 at 4:35 AM
Can you post the complete configuration you are using? Are you using the EntLibContrib OracleDatabase? That is the Database type that you would use with Oracle.DataAccess.Client. You could be missing a providerMappings xml configuration to map the database type to the Oracle.DataAccess.Client provider. The configuration should be similar to what is found at http://entlibcontrib.codeplex.com/wikipage?title=OracleDataProvider41&referringTitle=Home .

~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to