代码如下:
private void Page_Load(object sender, System.EventArgs e)
{
//if(IsPostBack==false) !IsPostBack
if(!IsPostBack)
string strconn= ConfigurationSettings.AppSettings["vote"];
SqlConnection cn= new SqlConnection (strconn);
cn.Open ();
SqlCommand cm1=new SqlCommand  ("SELECT DISTINCT time FROM News ",cn);
SqlDataReader dr1=cm1.ExecuteReader ();
while(dr1.Read ())
{
year.Items .Add (new ListItem(dr1["time"].ToString() ));
}
cn.Close ();  BindGrid();
}
出错语句是:string strconn= ConfigurationSettings.AppSettings["vote"];
请问如何修改?难道在Page_Load中不能这样吗?应该怎样修改?