Reputation: 30293
in my application i want to create dynamic datalist i created but it is not displaying this is my code help me please, thank u.
protected void btn_Click(object sender, EventArgs e) {
DataList datlst = new DataList();
datlst.ID = "mydatalist";
da = new SqlDataAdapter("select emname from emp", con);
ds = new DataSet();
da.Fill(ds, "emp");
datlst.DataSource = ds.Tables[0];
datlst.DataBind();
//this.Controls.Add(datlst);
form1.Controls.Add(datlst);
}
Upvotes: 0
Views: 111