StringBuilder sbSQLCompany = new StringBuilder(); sbSQLCompany.Append("Select HouseFeatureID,HouseName,Features from tblHouseFeatureP"); //SqlConnection conn = new SqlConnection(); //conn.ConnectionString = ConfigurationManager.ConnectionStrings["BuckshawHomesConnectionString"].ToString(); try { using (SqlConnection cn1 = new SqlConnection(ConfigurationManager.ConnectionStrings["BuckshawHomesConnectionString"].ConnectionString)) { using (SqlCommand cm1 = new SqlCommand(sbSQLCompany.ToString(), cn1)) { //cm1.Parameters.AddWithValue("@HouseFeatureID", Membership.GetUser().ProviderUserKey.ToString()); cn1.Open(); using (SqlDataReader rd = cm1.ExecuteReader(CommandBehavior.CloseConnection)) { while (rd.Read()) { string s = rd["Features"].ToString(); foreach (TreeNode Node in TreeView1.Nodes[0].ChildNodes) { if(rd["HouseName"].ToString()==tbPropertyName.Text) { if (Node.Depth == 1) { if (Node.Text == rd["Features"].ToString()) { Node.Checked = true; } else { Node.Checked = false; } } } } } } } catch { }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)