Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Closed No Longer Active
Question was poorly asked and was not understood.
I am going to take another track at solving this problem.
Posted
Updated 30-Aug-15 20:08pm
v3
Comments
Member 8345618 30-Aug-15 6:40am    
I have reviewed everything in the Debugger. The value for row item is Parts {[string [1]} which has a value of System.Data.DataRowView with no underlying value. When a linq query is used the value for row.item is:
Item: { SaleId = 17397, CaseNumber = TX-12-31861, County = DA, Mapsco = 55-P, Plaintiff = DALLAS COUNTY, ET AL, Defendant = VERSUS TONY B. WADE, ET AL, Address = 1623 EAST WOODIN BOULEVARD, City = Dallas, State = TX, ZipCode = 75203, JudgementAmount = 15549.0000, PropertyClass = LAND-R, YearOfConstruction = 0, Improv = 0, LegalDescription = L-9.55/3729 TRINITY HEIGHTS 3 (ACCOUNT #00000285625000000), AssessedValue = 11500.0000 } (parts {[string [18]}

So the problem doesn't lie with split, it is that there is no return value. Is it possible that the System.Data.DataRowView is somehow hiding the values from the datarow? If so any idea on how to access them?
Tom

Most likely the Split() returns an array of only one string in which case on the next line you try to target non-existing element parts[1]. Just turn on debugger and go this place step by step carefully to check what's going on.
 
Share this answer
 
Comments
Maciej Los 30-Aug-15 6:01am    
Good advice! A 5!
chainerlt 30-Aug-15 6:15am    
Also, even if there is more than one parts[], check if that part[1] string is long enough to Substring(14).
The error message tells you all.
either you try to access a place after the end of the array, either the array is shorter than expected which is more or less the same thing.
you say that the error is there:
C#
string inputParam = parts[1].Substring(14);

replace this line with:
C#
string Temp = parts[1];
string inputParam = Temp.Substring(14);

and see where it fails.
Use the debugger to see the values of variables when it fail.

Update

Hi Tom,
Looks like you let me a comment that have been deleted.
To get answers that fit your question, don't put the error message in title and remove the sentence after code.
Both are secondary effect of your real problem and they are misleading.
Your code is also related to the error message.
Focus on the problem.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900