'序列号
Dim lb As String = args(0) '类别
Dim rq As String = Format(Date.Today,"yyyyMMdd")
Dim xlh As Integer '序列号
Dim cmd As New SQLCommand
Dim sql As String =""
Dim dt As DataTable
cmd.ConnectionName = "chiplinksys"
sql = "select * fr om 序列号 where 账套 ='BJD' And 类别 = '" & lb & "' and 日期='" & rq & "' "
cmd.CommandText = sql
dt = cmd.ExecuteReader()
Dim rtval As String =""
If dt.DataRows.Count > 0 Then
rq = dt.DataRows(0)("日期")
xlh = dt.DataRows(0)("序列数") +1
rtval = lb & rq & Format(xlh,"000")
End If
Return rtval