2010-12-18 59 views

回答

0

我還沒有嘗試過這樣做,但已經快速瀏覽了EntLib數據塊,我看不到實現這一點的簡單方法。您可以使用SqlClient對象來完成它,但EntLib不支持您需要將數據作爲TVP傳遞的結構化數據類型。

如果你保證不需要任何東西,除了一個SQL Server後端,那麼我想你可以把你的連接轉換成一個特定於SQLServer的,然後使用SqlParameters,但這會在一定程度上破壞使用EntLib的目的。

+0

感謝您的意見。我也沒有看到明顯的方式,所以我只是使用ADO.NET來完成它。這並不壞。 :) – birdus 2010-12-20 07:40:53

+0

目前尚不支持它,因爲它僅僅是一個Sql 2008功能,並且我們沒有收到很多客戶請求來添加它。 – 2010-12-23 04:48:11

0

好運... http://msdn.microsoft.com/en-us/library/bb675163.aspx 報價:

表值參數

的侷限性

,有若干限制,以表值參數:

You cannot pass table-valued parameters to CLR user-defined functions. 

Table-valued parameters can only be indexed to support UNIQUE or PRIMARY KEY constraints. 
SQL Server does not maintain statistics on table-valued parameters. 

Table-valued parameters are read-only in Transact-SQL code. 
You cannot update the column values in the rows of a table-valued parameter and you cannot insert or delete rows. 
To modify the data that is passed to a stored procedure or parameterized statement 
in table-valued parameter, you must insert the data into a temporary table or into a table variable. 

You cannot use ALTER TABLE statements to modify the design of table-valued parameters. 
相關問題