HI all, I have an issue where i have to search rows in a datagrid view based on the key value given explicitly through textbox. This key value should be of any column in the datagridview. But unforutunately it works only for one column (in the below code column used is b)
string ss;
ss = textBox1.Text;
SqlConnection con = new SqlConnection("data source=localhost;integrated security=true;initial catalog=da");
da = new SqlDataAdapter("select * from me where a='"+ss+"' ", con);
da.Fill(ds, "me");
dt = ds.Tables[0];
dataGridView1.DataSource = dt;
DataView dv = ds.Tables[0].DefaultView;
//where b is a column in the table me. I need this function to work for multiple columns dv.RowFilter = "b='" + ss + "'"; ds.Tables.Clear(); ds.Tables.Add(dv.ToTable()); ds.AcceptChanges(); da.Update(dt);
Datagrid View before selecting