0

当我使用它时,我得到以下异常

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); 
...
4

1 回答 1

0

SqlDatabase对象支持此功能。因此,我不得不从.. 具体问题中调用它,而不是调用DiscoverParametersa 。GenericDatabaseSqlDatabase

于 2011-12-22T04:45:02.273 回答