DataSet aDataSet = cnn.QueryDataset("select * from book_subject where primary_id='" + this.choosetype.SelectedValue + "'");
this.DropDownList2.DataSource = aDataSet.Tables[0];
this.DropDownList2.DataTextField = aDataSet.Tables[0].Columns[1].ToString();
this.DropDownList2.DataValueField = aDataSet.Tables[0].Columns[2].ToString();
DropDownList2.DataBind();
this.DropDownList2.DataSource = aDataSet.Tables[0];
this.DropDownList2.DataTextField = aDataSet.Tables[0].Columns[1].ToString();
this.DropDownList2.DataValueField = aDataSet.Tables[0].Columns[2].ToString();
DropDownList2.DataBind();
if (!Page.IsPostBack)下
if (!Page.IsPostBack)
{
DataSet aDataSet = cnn.QueryDataset("select * from book_subject where primary_id='" + this.choosetype.SelectedValue + "'");
this.DropDownList2.DataSource = aDataSet.Tables[0];
this.DropDownList2.DataTextField = aDataSet.Tables[0].Columns[1].ToString();
this.DropDownList2.DataValueField = aDataSet.Tables[0].Columns[2].ToString();
DropDownList2.DataBind();
}
http://www.cnblogs.com/WizardWu/archive/2008/07/15/1243661.html