For Each rs As Row In e.form.Controls("Table1").Table.rows
Dim ccmd As New SQLCommand
ccmd.C
Dim str5,str6 As Integer
ccmd.commandtext = "select cd From dhkzl where code = '" & rs("hdcode") & "' " 此代码是得出对应行数据计算增长量从第几位开始,
str5 = ccmd.ExecuteScalar() 假设得到数据12
ccmd.commandtext = "select cdzj From dhkzl where code = '" & rs("hdcode") & "' " 此代码是得出计算增量数据共有几位,
str6 = ccmd.ExecuteScalar() 假设得到数据5
Dim sds As Integer = rs("qsbh").substring(str5,str6) 此代码是起始号码,例如为 920MA5012P010051E1,则正确结果SDS = 10051,但我写 代码 Dim sds As Double =substring(rs("qsbh") ,str5,str6) 代码报错.
Dim eds As Integer =rs("jsbh").substring(str5,str6) 此代码是结束号码,例如为 920MA5012P010070E1,则正确结果EDS = 10070,但我写 代码 Dim Eds As Double =substring(rs("jsbh") ,str5,str6) 代码报错.
For ii As Integer = sds To eds
Dim nrs As DataRow =DataTables("number").AddNew() (10051 与 10070之间相差20个数,这里循环增加)
nrs("num") = rs("qsbh").substring(0,str5) & format(ii, "00000") & "E1" '余下位数, (这里代码应该如何写,组合起来为 920MA5012P010051E1)
nrs.Save()
Next
Next