dynamic creating of menu in asp .net
<p>I am creating dynamic menu from database, but when i used to view the menu items and click on link button.it is not able to populate the menu.
What is wrong in my code? the error comes as Cannot find 0 in DataRow[] drow = ds.Tables[0].Select("IsActive=1"); Why it is coming?</p>

<pre><code>My code is

 protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    { FillMenu(); }
}

private void FillMenu()
{
    DataSet ds = new DataSet();

    DataRow[] drow = ds.Tables[0].Select("IsActive=1");
    foreach (DataRow dr in drow)
    {
        dt.ImportRow(dr);
    }
    dlMenu.DataSource = dt;
    dlMenu.DataBind();
    if (Session["Sublink"].ToString() != "")
    {

        SqlConnection conn = new SqlConnection(con);
        SqlDataAdapter da = new SqlDataAdapter();
        SqlCommand cmd = new SqlCommand("Select * from SubMenu where IsActive=1 and ParentId='" + Convert.ToInt16(Session["Sublink"].ToString()) + "'ORDER BY MenuOrder ", conn);
        da.SelectCommand = cmd;
        da.Fill(ds);
        dlSubMenu.DataSource = ds;
        dlSubMenu.DataBind();
    }
</code></pre>
