购物首页:
private void Page_Load(object sender, System.EventArgs e)
{
SqlConnection con=DB.creatcon();
con.Open();
SqlCommand cmd=new SqlCommand("select * from Goods",con);
SqlDataReader sdr=cmd.ExecuteReader();
this.DataGrid1.DataSource=sdr;
this.DataGrid1.DataBind();
sdr.Close();
con.Close();
// 在此处放置用户代码以初始化页面
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余3页未读,立即下载