Dim sql As String = "select * from 表 where " & combobox1.text & "='"+textbox1.text & "'"
Using da As New SqlClient.SqlDataAdapter(Sql, cnn), tb As New DataTable, bs As New BindingSource
da.Fill(tb)
bs.DataSource = tb
Me.DataGridView1.DataSource = bs
End Using |