0
使用SQL Server 2005瓦特/最新PetaPoco W /下面的代碼:PetaPoco輸出參數從存儲過程沒有返回
Dim count = New SqlParameter("@Count", System.Data.ParameterDirection.Output)
count.DbType = Data.DbType.Int32
Dim results = db.Query(Of User)(";exec SearchUserPaged @@[email protected], @@[email protected], @@[email protected], @@[email protected], @@[email protected] OUT",
New With {.page = pageEx, .maximumRows = maximumRowIndex, .ClientID = Me.ClientID, .SortExp = sortExpression, .Count = count}).ToList()
'Dim results = db.EDPEntities.Query(Of User)(";exec SearchUserPaged @@[email protected], @@[email protected], @@[email protected], @@[email protected], @@[email protected] OUTPUT",
' pageEx, maximumRowIndex, Me.ClientID, sortExpression, count).ToList()
If IsDBNull(count.Value) Then
Me.Count = 0
Else
Me.Count = count.Value
End If
但輸出參數總是返回相當新的PetaPoco值0。所以不知道如果我錯過了超級明顯的東西。
這裏是一個運行在查詢分析器通過精細地圖生成的SQL:
DECLARE @0 int,@1 int,@2 int,@3 nvarchar(4000),@4 int
SET @0=1
SET @1=25
SET @2=10145
SET @3=NULL
SET @4=2
exec SearchUserPaged @[email protected], @[email protected], @[email protected], @[email protected], @[email protected] OUT
SELECT @4
當我SELECT @4
返回正確的值。
什麼區別的默認值嗎? – Schotime