下面程序是将sort表的sort字段绑定到下拉框里。
public void BindPlan()
{
string mySelectQuery = "select id,sort from sort";SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);SqlCommand myCommand = new SqlCommand(mySelectQuery, myConnection);
myConnection.Open();
SqlDataReader myReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection);
id=Request.QueryString("id");DataRow dr = GetArticle(Request.QueryString["id"]);
string select= dr.ItemArray[3].ToString();
while (myReader.Read())
{
DropDownList1.Items.Add(myReader.GetString(1));
}
myReader.Close();}
请问?怎样别将id和sort分别帮定到DropDownList1的values和text属性上?