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この機能は、オブジェクトのみでサポートされています。したがって、 で を呼び出す代わりにDiscoverParameters、.. 仕様の問題GenericDatabaseから呼び出す必要がありました。SqlDatabase

于 2011-12-22T04:45:02.273 に答える