DataTables("合成_table2").DataRows.Clear
DataTables("合成_table1").Save
For Each dr As DataRow In DataTables("合成_table1").dataRows
If dr.IsNull("第一列")=True Then
dr.Delete ‘去除空值
End If
Next
Dim fh As WinForm.TextBox = e.Form.Controls("TextBox1") ‘指定连接符号
Dim len As WinForm.NumericComboBox = e.Form.Controls("NumericComboBox1") ’指定每行多少个
Dim ns() As String
Dim bt,bt1 As String
Dim i,i1 As Integer
Dim len1 As Integer
\'len1=DataTables("合成_table1").Compute("Count([第一列])", "第一列 <> \' \'")
If fh.Text<>"" AndAlso len.Value >0 AndAlso DataTables("合成_table1") IsNot Nothing Then
For Each dr As DataRow In DataTables("合成_table1").dataRows
If dr.IsNull("第一列")=False Then
bt &= "," & dr("第一列") ’和成字符串,例如 1,2,3,4,5,
Else
MessageBox.Show("请填写要合成的code!")
Exit For
End If
Next
If bt.Length>0 Then
ns=bt.SubString(1).split(",")
For i=0 To ns.Length-1 Step 14 \'len.Value
’bt1 &=bt1 & ns(i)
Tables("合成_table2").AddNew()
Tables("合成_table2").Current("第一列")=bt.TrimStart(",").SubString(i,len.Value) ‘想要生成表的每一行,这块怎么写呢
Next
End If
Else