Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
Accessing array elements with dynamic size
Michelle Oratil
Nov 19 2013 3:56 AM
801
Reply
Hi,
So I have an array named
Services[]
which is a return from a web service method.
I want to access its elements. Currently I have:
Services[] x = new Services[5];
x = getServicesLibrary();
for (int i = 0; i < x.Length; i++)
{
label1.text = x[i].servicecode.ToString() + "->" + x[i].servicedesc.ToString() + " ");
}
and the result is:
1->Laboratory
I am getting the first element only. How can I get all the elements of the array?
And also, is it possible to declare a dynamic size of the array? Since it is coming form a web service, I am assuming that the ServiceLibrary will expand.
Thank you so much!
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
how to call sql server store procedure in classic asp
Monitor already running application using my applicaton