MySqlConnection con;
con = new MySqlConnection(ConfigurationManager.ConnectionStrings["con"].ToString());
con.Open();
try
{
for (int i = 0; i < CblistForPravilage.Items.Count; i++)
{
if (CblistForPravilage.Items[i].Selected)
{
string var = string.Empty;
var += CblistForPravilage.Items[i].Value.ToString();
string str = "SELECT * FROM add_state where CID='" + var + "'";
MySqlCommand cmd;
cmd = new MySqlCommand(str, con);
MySqlDataAdapter da = new MySqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{
CblistForPravilage0.DataSource = ds;
CblistForPravilage0.DataTextField = "SName";
CblistForPravilage0.DataValueField = "SID";
CblistForPravilage0.DataBind();
}
}
}
}
catch
{
}
}