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