suryasasidhar 0 Newbie Poster

in my webapplication i create a dynamic datalist but it is not getting please help me this is my code thanku

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);
}

but it is not displaying anything help me thanku

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.