TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Cassie Mod
NA
488
70.4k
How to declare if yopu don't know the element ammount?
Feb 28 2017 5:59 AM
HI,
Ive got the following question?
how can i declare an array if you don't know how manny elements the array will finally contain ?
here is my example. I sed the wcfUser array could contain 1000 elements ( simply because i need to do a test to add 1000 users) but the wcfUser array could at the end just contain for example 15 elements ( you don't know it yet).
here is my code;
WcfUser[] usersInGroup =
new
WcfUser[1000];
// Get users GroupUsers request
var request =
new
GetGroupUsersRequest
{
requestId = _requestId,
serviceProviderId =
"DO_onepro"
,
jSessionId = _jsessionId,
sessionId = _sessionId,
domain =
"1pro.deanone.nl"
,
groupId =
"1PRO_DEMOIVO"
,
requestUsername =
"mhussein"
};
// GroupUsers response
using
(var client =
new
TechnicServiceClient())
{
var response = client.GetGroupUsers(request);
var errorCode = response.errorCode;
var errorMessage = response.errorMessage;
usersInGroup = response.users;
}
Reply
Answers (
3
)
download a pdf file using imagebutton in C#
file upload using mvc