-1

我有一个这样的存储过程:

ALTER procedure [dbo].[carcallvalidation]
@carid nvarchar(100)=null
as begin SET NOCOUNT ON;  select t.TBarcode, t.Paid,t.Status,t.DelDate from Transaction_tbl t where TBarcode=@carid declare @transid integer=null
select @transid= t1.transactID from Transaction_tbl t1 where TBarcode=@carid
if(select count(k.transactid) from KHanger_tbl k where k.transactid=@transid)>0
begin
return 1 end  end

在执行此操作时,我会这样:

TBarcode             Paid  Status      DelDate
-------------------- ----- ----------- -----------------------
57173621345          1     0           NULL  while i am checking this value using vb.net code like 

这个:

Dim dr As SqlDataReader
Dim payd As Integer
dr = cmdcarvalidation.ExecuteReader   While dr.Read
If dr("Paid") Is DBNull.Value Then payd = 0 Else
 payd = dr("Paid")  If payd = 1 Then  MsgBox("Payment Done") Exit Sub End If End If  End While

但是付费值取为-1 ..但在数据库中我将​​此值设为1.然后我如何获得-1值..

4

1 回答 1

0

在数据库中支付的数据类型是位,所以在代码中我们应该检查值是真还是假,不是0或1

于 2013-09-01T10:09:27.850 回答