private DataView view; private void txtSearch_TextChanged(object sender, EventArgs e) { if(radioButton1.Checked) { string input = txtSearch.Text; string conn = "Connection String here"; MySqlConnection myconn = new MySqlConnection(conn); string sql = "(Column1 LIKE '%" + sea + "%' OR Column2 LIKE '%" + sea + "%' OR Column3 LIKE '%" + sea + "%')"; //Column1, Column2 and Column3 represent some of my table columns MySqlDataAdapter da = new MySqlDataAdapter(sql, myconn); DataTable dt = new DataTable(); da.Fill(dt); view = dt.DefaultView; listBox1.DataSource = view; } }
System.Data.DataRowView
this.listBox1.DataSource = dt; this.listBox1.DisplayMember = "<required column name in the dt>";
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)