Dim cmd As New SQLCommand
cmd.ConnectionNam e = "" ‘复制后请消除关键字中的空格
cmd.CommandText = "Selec t Max([_Identify]) Fro m {表A} Where [第九列] Is Not Null" ‘复制后请消除关键字中的空格
Dim cnt As Integer = cmd.ExecuteScalar
Dim lst As New List(Of String)
Dim str As String
Dim dt As DataTable
For i As Integer = 1 To cnt
cmd.CommandText = "Selec t [第九列] Fro m {表A} Where [_Identify] = " & i ‘复制后请消除关键字中的空格
dt = cmd.ExecuteReader
If dt.DataRows.Count > 0 Then
str = dt.DataRows(0)("第九列")
For Each s As String In str.Split(":")
If lst.Contains(s) = False Then
lst.Add(s)
End If
Next
End If
Next
str = ""
lst.Sort
For i As Integer = 0 To lst.Count - 1
str + = lst(i) & "|"
Next
Output.Show(str.Trim("|"))