error in the below code-connot imlicitly convert type string to 'System.Web.UI.WebControls.ListItem'
Code:protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { SqlConnection cn=myClass.DBCon(); SqlCommand cmd=new SqlCommand("select CourseName from Course",cn); SqlDataReader dr=cmd.ExecuteReader(); while (dr.Read()) { if (DropDownList1.SelectedItem = dr["CourseName"].ToString()) { //code } } }




Reply With Quote
