if (txtcategory.Text != " ")
{
try
{
ConnectionString con = ConfigurationManager.ConnectionStrings["RetailTestConnection"].ToString();
con.Open();
string query = String.Format("Select [Item_Id]='{0}' order by Item_Id", txtcategory.Text);
SqlCommand cmd = new SqlCommand(query, con);
SqlDataReader dr = cmd.ExecuteReader();
string[] s = new string[] { };
while (dr.Read())
{
s = dr["Items"].ToString().Split(',');
}
int Length = s.Length;
for (int i = 0; i < Length - 1; i++)
// for (int i = 0; i <= 1; i++)
{
string fetr = s[i];
for (int j = 0; j <= clbbrand.Items.Count - 1; j++)
{
if (clbbrand.Items[j].ToString() == s[i])
{
clbbrand.SetItemChecked(j, true);
break;
}
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
else
{
// Message.Show("Please Eneter Your Choice");
}