A
Agnes
I got 2 sql statment to check whether the account code exsist in one of
their tables. and then want to get the counter.
Thanks a lot.
-----my vb.net syntax-----
cmdSearch.Parameters.Add(New SqlParameter("@acctcode",
SqlDbType.VarChar, 20)).Value = Me.txtAcctCode.Text.Trim
cmdSearch.Parameters.Add(New SqlParameter("@countno",
SqlDbType.Int))
cmdSearch.Parameters("@countno").Direction =
ParameterDirection.Output
Try
Dim drCntrId As SqlDataReader =
cmdSearch.ExecuteReader(CommandBehavior.SingleRow)
While drCntrId.Read
intCount = drCntrId.Item("countno") <-- It seems do nothing
and I can get the countno
End While
DECLARE @countno_gljn as int
DECLARE @countno_arinv as int
/*GLJNHEADER*/
select @countno_gljn = count(VD.acctcode)
from gljnheader vh,gljndetail vd
where vh.voucherno = vd.voucherno and vh.validsw = 1 and rtrim(vd.acctcode)
= rtrim(@acctcode)
/*ARINVHEADER*/
select @countno_arinv = count(VD.acctcode)
from arinvinfo vh,arinvchg vd
where vh.invno = vd.invno and vh.validsw = 1 and rtrim(vd.acctcode) =
rtrim(@acctcode)
SELECT @countno = @countno_gljn + @countno_arinv
RETURN @countno
go
their tables. and then want to get the counter.
Thanks a lot.
-----my vb.net syntax-----
cmdSearch.Parameters.Add(New SqlParameter("@acctcode",
SqlDbType.VarChar, 20)).Value = Me.txtAcctCode.Text.Trim
cmdSearch.Parameters.Add(New SqlParameter("@countno",
SqlDbType.Int))
cmdSearch.Parameters("@countno").Direction =
ParameterDirection.Output
Try
Dim drCntrId As SqlDataReader =
cmdSearch.ExecuteReader(CommandBehavior.SingleRow)
While drCntrId.Read
intCount = drCntrId.Item("countno") <-- It seems do nothing
and I can get the countno
End While
DECLARE @countno_gljn as int
DECLARE @countno_arinv as int
/*GLJNHEADER*/
select @countno_gljn = count(VD.acctcode)
from gljnheader vh,gljndetail vd
where vh.voucherno = vd.voucherno and vh.validsw = 1 and rtrim(vd.acctcode)
= rtrim(@acctcode)
/*ARINVHEADER*/
select @countno_arinv = count(VD.acctcode)
from arinvinfo vh,arinvchg vd
where vh.invno = vd.invno and vh.validsw = 1 and rtrim(vd.acctcode) =
rtrim(@acctcode)
SELECT @countno = @countno_gljn + @countno_arinv
RETURN @countno
go