I have no clue what's going on here, I think it's a bug, but, when I set a breakpoint in my code, before I run a check for a specific control type in an array:
the paramVals[1] is there, but, if I don't set the breakpoint before the paramVals[1] is changed (there are 6 paramvals) all are there except the one at spot 1, which is null.
Again it works when the checkpoint is set before paramVals[i which is 1] is changed, but if I don't add a breakpoint there, it ends up being null and the add method breaks. Any ideas?
Code:
if (objectType == "Contractor")
{
for (int i = 0; i < paramVals.Count; i++)
{
if (paramVals[i].GetType() == typeof(TextBox))
{
//}
//Type t = paramVals[i].GetType();
//if (t.Name == "TextBox")
//{
TextBox tb = (TextBox)paramVals[i];
if (tb.ID.ToString() == "cntr_ContactName")
{
if (dbRetrieve.getContactName(tb.Text) == "")
{
oldTB = tb;
oldTBloopIndex = i;
oldtbID = tb.ID;
dbupdate.addContactName(tb.Text);
paramVals[i] = dbRetrieve.modTextBox(paramVals[i]);
}
else
{
paramVals[i] = dbRetrieve.modTextBox(paramVals[i]);
}
}
}
}
dbupdate.addObject(paramVals, objectType);
oldTB.ID = oldtbID;
paramVals.RemoveAt(oldTBloopIndex);
paramVals.Insert(oldTBloopIndex, oldTB);
}
the paramVals[1] is there, but, if I don't set the breakpoint before the paramVals[1] is changed (there are 6 paramvals) all are there except the one at spot 1, which is null.
Again it works when the checkpoint is set before paramVals[i which is 1] is changed, but if I don't add a breakpoint there, it ends up being null and the add method breaks. Any ideas?