R
Robert Smit
I have the following problem:
If I run this code:
dagCap1.berekenDagCapaciteit(ref lbOrderDag1);
I get the error that I can't read the first row from the ListBox.
System.IndexOutOfRangeException: There is no row at position 0
this is the function I use:
public void berekenDagCapaciteit(ref ListBox lbDag)
{
double tempOrderTime = 0.0d;
for (int i = 0; i < lbDag.Items.Count; i++)
{
string orderNr = Convert.ToString(lbDag.Items);
uitvoerenQuery(orderNr);
tempOrderTime = (aantal * runTime) + setupTime;
totaalOrderTime += tempOrderTime;
totaalFreeTime = dagCap - totaalOrderTime;
}
}
When I try to acces the first row when I don't use the for loop for
example like this: r = Convert.ToString(lbDag.Items[0]); The first
item does have a value. I can't find out what's wrong. Has it
something to do with the loop?
Who can help me out,
Robert Smit
If I run this code:
dagCap1.berekenDagCapaciteit(ref lbOrderDag1);
I get the error that I can't read the first row from the ListBox.
System.IndexOutOfRangeException: There is no row at position 0
this is the function I use:
public void berekenDagCapaciteit(ref ListBox lbDag)
{
double tempOrderTime = 0.0d;
for (int i = 0; i < lbDag.Items.Count; i++)
{
string orderNr = Convert.ToString(lbDag.Items);
uitvoerenQuery(orderNr);
tempOrderTime = (aantal * runTime) + setupTime;
totaalOrderTime += tempOrderTime;
totaalFreeTime = dagCap - totaalOrderTime;
}
}
When I try to acces the first row when I don't use the for loop for
example like this: r = Convert.ToString(lbDag.Items[0]); The first
item does have a value. I can't find out what's wrong. Has it
something to do with the loop?
Who can help me out,
Robert Smit