J
Jon Skeet [C# MVP]
plork said:I'm calling an external web service method and it retruns a complex
type which is an array
for (int i = 0; i < array.Length; i++)
{
ComplexType results = array ;
No, that's not a complex type which is an array - it's an array *of
ComplexType objects*.
each results looks like this when i look in visual studio
Array Result value
|-id "1000"
|-title "aaa"
|-description "some text"
all i want to do is loop through the 'array' retruned from the
webserivce call and group the 1000's together, 2000's together etc
i thought i could do this
for (int i = 0; i < array.Length; i++)
{
ComplexType results = array ;
if (results.id = "1000")
{
create another array
ComplexType 1000Array = new ComplexType ();
1000Array.add - but when i click CTRL+Space next to 1000Array i don't
get Add in the intellisense
}
Well, there are three reasons for this:
1) 1000Array isn't a valid identifier
2) ComplexType isn't an array
3) Array doesn't have an Add method anyway (leaving aside IList.Add)
Without wishing to be rude, I *strongly* suggest you learn some basic
C# before going into web services etc.