Dim dt As DataTable = DataTables("出库") For i As Integer = 0 To e.Form.Controls("TextBox1").Lines.Length - 1 If dt.GetValues("出库单编号","出库单编号 Is Not Null").Contains(e.Form.Controls("TextBox1").Lines(i)) = False Then Dim dr As DataRow = dt.AddNew dr("出库单编号") = e.Form.Controls("TextBox1").Lines(i) End If Next