//获得所有论坛名称并填入下接列表中
string sql;
OleDbDataReader dr;
sql="SELECT forumid, forumname FROM forum ORDER BY forumid";
OleDbCommand cmd;
OleDbConnection con=new OleDbConnection(ConfigurationSettings.AppSettings["con.ConnectionString"]);
cmd=new OleDbCommand(sql,con);
con.Open();
dr=cmd.ExecuteReader();
this.ddlForumName.Items.Add(new ListItem("所有论坛", "0"));
while(dr.Read())
{
ListItem li=new ListItem(dr["forumname"].ToString(),dr["forumid"].ToString());
this.ddlForumName.Items.Add(li);
if(li.Value==sforumid)
{
this.ddlForumName.SelectedValue=li.Value ;
}
}
dr.Close();
con.Close();