Four possibilities:
1) Idata is not set to anything
2) Id is not set to anything
3) el is not set to anything
4) el has no children.
Assuming you have checked Idata, Id, and el, and that they are all valid, then re-code it a bit more defensively:
do
{
HtmlElementCollection elc = el.Children;
if (elc != null)
{
Id.CodeData = elc[0].InnerText;
Id.StockData = elc[1].InnerText;
Id.TypeData = elc[2].InnerText;
Id.QuantityData = elc[3].InnerText;
Id.PartData = elc[4].InnerText;
Idata.Add(Id);
}
el = el.NextSibling;
} while (el!= null);