if(!Page.IsPostBack) { SqlConnection conn = new SqlConnection(con); conn.Open();
string strSql = "select count(id) as countID from 公告"; SqlCommand cm = new SqlCommand(strSql,conn);
string intCount = cm.ExecuteScalar().ToString(); conn.Close();
Label1.Text = intCount; }