//绑定DropDownList默认数据 private void BindData() { BLL.BLLGet_chart_Data DGD = new BLL.BLLGet_chart_Data(); //if (this.sec_type.Items[this.sec_type.SelectedIndex].Value == "T_BASE_PARAID_WIND") //{ DataSet DS = DGD.Get_Paraid("administrator.T_BASE_CHARTPARAID", "T_LEVEL1", "11"); if (DS != null && DS.Tables[0].Rows.Count > 0) { DataSet DDS = DGD.Get_Paraid("administrator.T_BASE_CHARTPARAID", "T_LEVEL2", DS.Tables[0].Rows[0][0].ToString()); DataSet DDDS = DGD.Get_Paraid("administrator.T_BASE_CHARTPARAID", "T_LEVEL3", DDS.Tables[0].Rows[0][0].ToString()); this.ddl_level1.DataSource = DS; this.ddl_level1.DataTextField = "T_LEVEL1"; this.ddl_level1.DataValueField = "T_LEVEL1"; this.ddl_level1.DataBind(); this.ddl_level2.DataSource = DDS; this.ddl_level2.DataTextField = "T_LEVEL2"; this.ddl_level2.DataValueField = "T_LEVEL2"; this.ddl_level2.DataBind(); this.ddl_level3.DataSource = DDDS; this.ddl_level3.DataTextField = "T_LEVEL3"; this.ddl_level3.DataValueField = "T_LEVEL3"; this.ddl_level3.DataBind(); } }
//绑定DropDownList默认数据 private void BindData() { BLL.BLLGet_chart_Data DGD = new BLL.BLLGet_chart_Data(); //if (this.sec_type.Items[this.sec_type.SelectedIndex].Value == "T_BASE_PARAID_WIND") //{ DataSet DS = DGD.Get_Paraid("administrator.T_BASE_CHARTPARAID", "T_LEVEL1", "11"); if (DS != null && DS.Tables[0].Rows.Count > 0) { DataSet DDS = DGD.Get_Paraid("administrator.T_BASE_CHARTPARAID", "T_LEVEL2", DS.Tables[0].Rows[0][0].ToString()); DataSet DDDS = DGD.Get_Paraid("administrator.T_BASE_CHARTPARAID", "T_LEVEL3", DDS.Tables[0].Rows[0][0].ToString()); this.ddl_level1.DataSource = DS; this.ddl_level1.DataTextField = "T_LEVEL1"; this.ddl_level1.DataValueField = "T_LEVEL1"; this.ddl_level1.DataBind(); this.ddl_level2.DataSource = DDS; this.ddl_level2.DataTextField = "T_LEVEL2"; this.ddl_level2.DataValueField = "T_LEVEL2"; this.ddl_level2.DataBind(); this.ddl_level3.DataSource = DDDS; this.ddl_level3.DataTextField = "T_LEVEL3"; this.ddl_level3.DataValueField = "T_LEVEL3"; this.ddl_level3.DataBind(); } }
private DataSet Return_dataset(string id, string level_id, string para_id) { //<option value=" + array[1].split(',')[i] + ">" + array[1].split(',')[i] + "</option> DataSet DS = DGD.Get_Paraid(id, level_id, para_id); for (int i = 0; i < DS.Tables[0].Rows.Count; i++) { sb.Append("<option value=" + DS.Tables[0].Rows[i][0].ToString() + ">" + DS.Tables[0].Rows[i][0].ToString() + "</option>"); //sb.Append(DS.Tables[0].Rows[i][0].ToString()); //if (i != DS.Tables[0].Rows.Count - 1) //{ // sb.Append(","); //} } sb.Append("|"); return(DS); }