Did you try this?
foreach (DataRow masterRow in ds.Tables[0].Rows)
{
MenuItem masterItem = new MenuItem(" " + (string)masterRow["menu_name"] + " ");
masterItem.NavigateUrl = ((string)masterRow["menu_url"]);
MainMenu.Items.Add(masterItem);
foreach (DataRow childRow in masterRow.GetChildRows("Children"))
{
MenuItem childItem = new MenuItem((string)childRow["menuitem_name"]);
masterItem.ChildItems.Add(childItem);
childItem.NavigateUrl = ((string)childRow["menu_url"]);
}
}