argumentoutofrangeexception was unhandled by user code asp net

Actually my code is this ,am  getting this error for substring .
here am writing my code this error.

try
            {
                if (tbMeterID.Text == "")
                    return;
                if (tbMeterID.Text.Substring(4, 1) == "E")
                {

                   //do some thing
                  }
}

 am change the code as below.
am solved this prob like this way.

if (tbMeterID.Text != "")
            {
                bool meter = tbMeterID.Text.Substring(4, 1).Equals("E");

                this.radBusyIndicator.IsBusy = false;
                if (e.Result.routeID == null)
                    return;

               
                if (meter == true)
                {

                   //do something
                }
}

Comments

Popular posts from this blog

what is Event Cache table in sharepoint

CAML Query syntax and options in SharePoint

Change anchor link url in sharepoint calender