【发布时间】:2013-07-28 17:47:15
【问题描述】:
有人见过吗?
Public Shared Function IsAvailableByCampaignId(ByVal cn As SqlConnection, ByVal tr As SqlTransaction, ByVal campaignId As Integer, ByRef dest As PricingThresholds) As Boolean
Dim retObj = ItemTypes.PricingThresholds.GetThresholds(cn, tr, campaignId)
If retObj IsNot Nothing Then
dest = New PricingThresholds(retObj)
End If
Dim retVal As Boolean = retObj IsNot Nothing
Return retVal
End Function
当我调用内部
Dim retObj = ItemTypes.PricingThresholds.GetThresholds(cn, tr, campaignId)
我得到一个非 null 或什么都没有的 retObj,但随后我用它来构建一个新的 PricingThresholds,这是我需要返回的正确类型,并且成功创建了一个有效的返回类型对象,但我回来了从外部调用 parm dest 传递的ByRef 没有任何值,并且是空值或空值。
这就像 VB 不工作。
我想我可以换一种方式退货。
【问题讨论】:
-
VB.NET 工作正常,您的代码没有做正确的事情。你能告诉我们你在哪里以及如何调用这个函数吗?问题可能就在那里。
标签: vb.net vb.net-2010