select * from table_name where t_id IN ('8','9')
string whereCndn = string.Empty; foreach (var item in ChkM.SelectedItems) { if (item.Selected) { whereCndn += item.SelectedValue + ","; //Here you will get set of selected checkbox value like (8,9,) } } string str = "select * from table_name where t_id IN ("+ whereCndn.Remove(whereCndn.Length - 1) +")"; //Removing last comma character from the string and putting it in string DataTable dt = new DataTable(); dt = con.select(str); if (dt.Rows.Count >= 1) { rptr.DataSource = dt; rptr.DataBind(); }
var selectedVal = str.TrimEnd(',');
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)