You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 25, 2020. It is now read-only.
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
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)
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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)
The text was updated successfully, but these errors were encountered: