I am working on a project where I need to display data from database to datagridview depending on combobox multiselection. Something like Data filter in MS Excell.
On checking or unckecking combobox item populate datagridview.
I was thinking to achieve this in this way?
SELECT * FROM articles WHERE name LIKE
Combobox is populating from database.
I am working in VS 2010, sqlCEserver, .net 3.5
Can someone have any idea how to do it?
Thank you.

Iftikar HussainRank #423 · 5.9K reputationPosted Jul 30, 2013, 8:51 PM EDT
Is it the same post
http://www.c-sharpcorner.com/Forums/Thread/221920/filtering-database-data.aspx
Regards,
Iftikar
Konstantin Pankarican18 reputationPosted Jul 30, 2013, 10:16 PM EDT
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 30, 2013, 10:17 PM EDT
Regards,
Iftikar
Konstantin Pankarican18 reputationPosted Jul 31, 2013, 10:26 PM EDT
here's the code:
conn.Open();
SqlCommand sc = new SqlCommand("select naziv,cena from artikli", conn);
SqlDataReader reader; reader = sc.ExecuteReader();
DataTable dt = new DataTable();
dt.Columns.Add("naziv", typeof(string));
dt.Columns.Add("cena", typeof(string));
dt.Load(reader); comboBox1.ValueMember = "naziv"; comboBox1.DisplayMember = "cena"; comboBox1.DataSource = dt; conn.Close();
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 31, 2013, 10:32 PM EDT
Regards,
Iftikar