当我使用它时,我得到以下异常
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);
...