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
Anurag Malani
NA
80
34.3k
The array bounds are invalid in c# windows service
Nov 11 2013 2:40 AM
Hi,
I have a problem on C# windows service, its showing an error - The array bounds are invalid
Note - If my dv.Count value is less than or equal to 1000 then its not showing error and works fine, but id dv.Count is more then 1000 then it generate the error....
Here is my code
string[] arg = new string[dv.Count];
for (int xx = 0; xx < dv.Count; xx++)
{
arg[xx] = dv[xx]["id"].ToString() + "," + dv[xx]["item"].ToString()
}
ServiceController sc = new ServiceController("Service1");
if (sc != null)
{
if (sc.Status.ToString().ToLower() == "stopped")
{
sc.Start(arg);
// Error Occurred Here
}
}
Here is the full error details.
System.InvalidOperationException: Cannot start service xxxxx on computer '.'. ---> System.ComponentModel.Win32Exception: The array bounds are invalid
--- End of inner exception stack trace ---
at System.ServiceProcess.ServiceController.Start(String[] args)
at xxxxxx.Service1.Generate(Object sender, ElapsedEventArgs e)
Can someone please help on this...?
Reply
Answers (
1
)
How to handle timeout in socket communication using c#.net
Windows service in windows 2008 R2