Skip to content
This repository was archived by the owner on Feb 25, 2020. It is now read-only.
This repository was archived by the owner on Feb 25, 2020. It is now read-only.

EnterpriseLibrary.Data.NetCore - Parameter discovery is not supported for connections using GenericDatabase #39

@rajputs6

Description

@rajputs6

I am creating ASP.NET MVC Core 2.2 web app with enterprise library for .Net Core for data access. EnterpriseLibrary.Data.NetCore 6.0.1313 with SQL Server 2016. I want to call ExecuteSprocAccessor without defining paramter map and just passing a value. I have writtern one stored procedure to call with one parameter and passing only one paratmer value in ExecuteSprocAccessor like this

sqlDatabase.ExecuteSprocAccessor("[app].[User_SelectByUserName]", "johnK").FirstOrDefault();

and stored procedute is

ALTER PROC [app].[User_SelectByUserName]
@UserName NVARCHAR(100)

AS

BEGIN

SELECT FROM [app].[User].......

END

But I am getting following error.

{System.NotSupportedException: 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. at Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase.DeriveParameters(DbCommand discoveryCommand) at Microsoft.Practices.EnterpriseLibrary.Data.Database.DiscoverParameters(DbCommand command) at Microsoft.Practices.EnterpriseLibrary.Data.ParameterCache.SetParameters(DbCommand command, Database database) at Microsoft.Practices.EnterpriseLibrary.Data.Database.AssignParameters(DbCommand command, Object[] parameterValues) at Microsoft.Practices.EnterpriseLibrary.Data.SprocAccessor`1.Execute(Object[] parameterValues)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions