private void BindData()
{
string commandText = "select * from ArticleType";
//----------
OleDbConnection conn = new OleDbConnection();
conn.ConnectionString = connString;
conn.Open();
OleDbDataAdapter da = new OleDbDataAdapter(commandText,conn);
DataSet ds = new DataSet();
da.Fill(ds,"ArticleType");
conn.Close();
//----------
DataList1.DataSource = ds.Tables["ArticleType"];
DataList1.DataBind();
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.DataList1.ItemDataBound += new System.Web.UI.WebControls.DataListItemEventHandler(this.DataList1_ItemDataBound);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion