protected System.Web.UI.WebControls.DataGrid DataGrid1;
SqlConnection conn=new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["dsn"]);
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if(!Page.IsPostBack)
{
SqlCommand myCommand = new SqlCommand("actList",conn);
myCommand.CommandType = CommandType.StoredProcedure ;
conn.Open();
SqlDataReader MyDataReader = myCommand.ExecuteReader();
DataGrid1.DataSource = MyDataReader;
DataGrid1.DataBind();
MyDataReader.Close();
conn.Close();
}