Dim dt1 As DataTable Dim ds1 As New DataSet cnn = New OleDbConnection(connectionString) Dim clientList As String = "(" For item1 As Integer = 0 To CheckedListBox2.CheckedItems.Count - 1 clientList += "'" & CheckedListBox2.CheckedItems(item1) & "'," Next clientList = clientList.Substring(0, clientList.Length - 1) + ")" Dim sql1 = "select * from NTIdb where Client in " + clientList Try cnn.Open() adptr = New OleDbDataAdapter(sql1, cnn) adptr.Fill(ds1) adptr.Dispose() cnn.Close() dt1 = ds1.Tables(0) Form5.DataGridView1.DataSource = dt1 Catch ex As Exception MsgBox(ex.ToString) End Try Form5.DataGridView1.Visible = True
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)