Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

specific arraylis object not passed unless proper checkpoint set?

Status
Not open for further replies.

tekkerguy

Programmer
Nov 16, 2005
196
US
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:

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?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top