if(!Page.IsPostBack)
{
SqlConnection conn = new SqlConnection(con);
conn.Open();
string strSql = "select * from 公告";
SqlCommand cm = new SqlCommand(strSql,conn);
SqlDataAdapter Adapter = new SqlDataAdapter();
DataSet ds = new DataSet();
Adapter.SelectCommand = cm;
Adapter.Fill(ds,"公告");
conn.Close();
DataGrid1.DataSource = ds.Tables["公告"].DefaultView;
DataGrid1.DataBind();
}