我有以下stored procedure
Create Procedure [dbo].[spVerifyCustomerUserLogin]
@EmbossLine varchar(16),
@password varchar(50)
as
Select C.EmbossLine,C.EmbossName,round(CB.TotalLoading,2),round(CB.Totalredemption,2),round(CB.CardBalance,2)
from Card C inner join CardBalance CB on CB.PAN=C.EmbossLine
where
EmbossLine = @EmbossLine
and [password] = @password
and Status='E0'
我有以下VB.Net
代码可以访问它:
Dim UserData As New ArrayList
Dim dr As SqlDataReader
dr = GenericDB.ExecuteSPForDataReader("spVerifyCustomerUserLogin", spParameters)
If dr.HasRows Then
dr.Read()
UserData.Add(dr.Item("EmbossLine"))
UserData.Add(dr.Item("EmbossName"))
UserData.Add(dr.Item("TotalLoading"))
UserData.Add(dr.Item("Totalredemption"))
UserData.Add(dr.Item("CardBalance"))
dr.Close()
Return UserData
End If
dr.Close()
Return UserData
问题是我的代码IndexOutOfRangeException
在
UserData.Add(dr.Item("TotalLoading"))
请注意,当我访问没有该round
函数的存储过程时,它可以正常工作,因此它与我的圆形函数有关。请注意,我的 Fields和TotalLoading
是money 类型。是不是因为这个?TotalRedemption
CardBalance