Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
Dim cmd1 As New SQLCommand
Dim dt1 As Date
cmd1.C
cmd1.CommandText = "Select GetDate()"
dt1 = cmd1.ExecuteScalar()
e.DataRow("制单日期") = dt1.Date
Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.C
cmd.CommandText = "SELECT * From {采购申请单主明细} where 制单日期 = '" & dt1.Date & "'"
dt = cmd.ExecuteReader()
Dim x As Integer = dt.DataRows.Count + 1
e.DataRow("单据编号") = "请-" & Format(dt1.Date,"yyMMdd") & "-" & Format (x,"00")
这是我的 放在新增行事件中
Dim cmd1 As New SQLCommand
Dim dt1 As Date
cmd1.C
cmd1.CommandText = "Select GetDate()"
dt1 = cmd1.ExecuteScalar()
e.DataRow("制单日期") = dt1.Date
Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.C
cmd.CommandText = "SELECT * From {采购申请单主明细} where 制单日期 = '" & dt1.Date & "'"
dt = cmd.ExecuteReader()
Dim x As Integer = dt.DataRows.Count + 1
e.DataRow("单据编号") = "请-" & Format(dt1.Date,"yyMMdd") & "-" & Format (x,"00")
这是我的 放在新增行事件中
要获得记录数,只需Select count([_dentify]) From {表名} From 条件。
呵呵,把帮助的稍微改一些,就可以用于多个表了:
下载信息 [文件大小: 下载次数: ] | |
![]() |
用帮助的方法好,大家自行琢磨出来的办法,在多用户环境下,有产生重复编号的可能性。