How to create datalist dynamically
<p>In my application I want to create a dynamic datalist and bind the database values. please help me
this is my code</p>

<pre><code>protected void btn_Click(object sender, EventArgs e)
{
    DataList datlst = new DataList();
    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);
}
</code></pre>
