Screenshot me returns the error index was Outside-the Bounds of the array

Asked

Viewed 974 times

2

I have a screen that saves users, and assigns value to them, but whenever I click the save button it returns me the index error was Outside-the Bounds of the array , I already searched lines and could not find anything.

string[] commandParam = processParam.Split(new string[] { GV.stSep }, StringSplitOptions.None);
        string[] field = commandParam[0].Split(new string[] { GV.stSep2 }, StringSplitOptions.None);
        string[] value = commandParam[1].Split(new string[] { GV.stSep2 }, StringSplitOptions.None);

Above is where the error in C is#,

Below is the possible error in Javascript

var wrData = null;

        scr.getGrid("GWOReprogram").clear();

        if (cbReprogPeriod == "0"){

            wrData = "fromDate" + STSEP2 +                  
                        "workOrder" + STSEP2 +
                        "worker" + STSEP2 +
                        scr.getValue("TBFromDate") + STSEP2 +                 
                        workerWOReprogram.getRSWorkOrderValue() + STSEP2 +               
                        workerWOReprogram.getRSWorkerValue() + STSEP2 +   
                        "1";            
        }
        else{

            "fromDate|workOrder|

            wrData = scr.getValue("TBFromDate") + STSEP2 +                  
                        scr.getValue("RSWorkOrder" + STSEP2 +
                        scr.getValue("RSWorker" + STSEP2 +
                        scr.getValue("TBFromDate") + STSEP2 +                            
                        workerWOReprogram.getRSWorkerValue() + STSEP2 +   
                        "1";            
        }

Someone can help me?

  • 2

    The problem should be when you do processParam.Split does not return a array with two indexes but only one, so when you try to access the 2nd index (position 1 of array) gives error. You have to put more information in your question. What is the separator GV.stSep? Where does it come from? What is the connection between JS and C#?

  • 1

    @Joãomartins That’s right, thanks for helping !!! I will not answer your questions because I found the error based on your tip, we are together!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.