[英]Get all stored procedure output parameters using generic type in dapper
[英]How to get the parameters for a stored procedure using Enterprise library with generic database
當我使用它時,出現以下異常
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.
除了此過程,還有其他正確的方法嗎?
編輯
Database db = CustomDbFactory.CreateDataBase(connStrName);
DbCommand command = db.DbProviderFactory.CreateCommand();
command.CommandText = @spName;
command.CommandType = CommandType.StoredProcedure;
db.DiscoverParameters(command);
...
僅SqlDatabase
對象僅支持此功能。 因此,不必在GenericDatabase
上調用DiscoverParameters
,而必須從SqlDatabase
進行調用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.