2011-12-21 60 views
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); 
... 
+0

如果您提供的代碼和配置我們可能會幫助 – 2011-12-21 13:27:56

+0

請編輯您的原始帖子並在其中提供代碼和配置。把它放在評論中是沒有用的。 – 2011-12-21 14:39:23

+0

@JasonMeckley:完成編輯問題以添加參考碼 – Saravanan 2011-12-22 04:29:23

回答

0

此功能僅只有SqlDatabase對象的支持。因此,我不得不打電話DiscoverParametersGenericDatabase,我不得不打電話給SqlDatabase ..具體問題。

相關問題