Click here to Skip to main content
15,920,438 members
Home / Discussions / C#
   

C#

 
AnswerRe: ?How add a database to my c# project? Pin
Christian Graus20-Jun-09 11:26
protectorChristian Graus20-Jun-09 11:26 
QuestionRe: ?How add a database to my c# project? Pin
H.R(Hamid reza)21-Jun-09 2:29
H.R(Hamid reza)21-Jun-09 2:29 
QuestionPassing a Graphics object Pin
Member 95042020-Jun-09 10:39
Member 95042020-Jun-09 10:39 
AnswerRe: Passing a Graphics object Pin
0x3c020-Jun-09 10:49
0x3c020-Jun-09 10:49 
GeneralRe: Passing a Graphics object Pin
Member 95042020-Jun-09 11:56
Member 95042020-Jun-09 11:56 
GeneralRe: Passing a Graphics object Pin
Luc Pattyn20-Jun-09 12:14
sitebuilderLuc Pattyn20-Jun-09 12:14 
AnswerRe: Passing a Graphics object Pin
Christian Graus20-Jun-09 11:29
protectorChristian Graus20-Jun-09 11:29 
AnswerRe: Passing a Graphics object Pin
Luc Pattyn20-Jun-09 11:29
sitebuilderLuc Pattyn20-Jun-09 11:29 
QuestionNeed a container like visual studio toolbox. Pin
hdv21220-Jun-09 10:38
hdv21220-Jun-09 10:38 
AnswerRe: Need a container like visual studio toolbox. Pin
Christian Graus20-Jun-09 11:29
protectorChristian Graus20-Jun-09 11:29 
GeneralRe: Need a container like visual studio toolbox. Pin
hdv21220-Jun-09 12:01
hdv21220-Jun-09 12:01 
GeneralRe: Need a container like visual studio toolbox. Pin
Christian Graus20-Jun-09 12:48
protectorChristian Graus20-Jun-09 12:48 
QuestionWindows Service Controlle in VS2008 Pin
Whitaker.Mike20-Jun-09 5:10
Whitaker.Mike20-Jun-09 5:10 
Hi,

I hope some one out there can help me! I have been goggling my brains out all day tiring to find the answer for this question I have:

I'm using visual studio 2008 and I am pretty much a noob to c#. So go easy on me.
Trying to write a console app that checks the status of a windows service and if it is up stops it and if it's down brings it up! But the problem is that the book I am using to teach myself c# in vs 2008 does not describe this. And also to code that I do find on the web is for 2005 and doesn't work in 2008! I might look a bit liker this:

public static void StartService(string serviceName, int timeoutMilliseconds)
{
ServiceController service = new ServiceController(serviceName);
try
{
TimeSpan timeout = TimeSpan.FromMilliseconds(timeoutMilliseconds);

service.Start();
service.WaitForStatus(ServiceControllerStatus.Running, timeout);
}
catch
{
// ...
}
}

But as I stated earlier the ServiceController class doesn't seem to work in 2008, or I could just be a dim whit...

So any idea you might have as of how I might do this would make my day!
Thanks in advice,

Mike
AnswerRe: Windows Service Controlle in VS2008 Pin
ProtoBytes20-Jun-09 5:34
ProtoBytes20-Jun-09 5:34 
AnswerRe: Windows Service Controlle in VS2008 Pin
DaveyM6920-Jun-09 9:40
professionalDaveyM6920-Jun-09 9:40 
AnswerRe: Windows Service Controlle in VS2008 Pin
Shukla Rahul20-Jun-09 10:09
Shukla Rahul20-Jun-09 10:09 
GeneralRe: Windows Service Controlle in VS2008 Pin
Whitaker.Mike21-Jun-09 3:26
Whitaker.Mike21-Jun-09 3:26 
QuestionWeb service problem - error when binding to datagrid [modified] Pin
Gindi Bar Yahav20-Jun-09 4:29
Gindi Bar Yahav20-Jun-09 4:29 
AnswerRe: Web service problem - error when binding to datagrid Pin
ProtoBytes20-Jun-09 5:23
ProtoBytes20-Jun-09 5:23 
GeneralRe: Web service problem - error when binding to datagrid Pin
Gindi Bar Yahav20-Jun-09 6:55
Gindi Bar Yahav20-Jun-09 6:55 
QuestionHow do I check whether the "X" button in the top right corner was clicked? Pin
Etienne_12320-Jun-09 2:39
Etienne_12320-Jun-09 2:39 
AnswerRe: How do I check whether the "X" button in the top right corner was clicked? Pin
Luc Pattyn20-Jun-09 2:42
sitebuilderLuc Pattyn20-Jun-09 2:42 
AnswerRe: How do I check whether the "X" button in the top right corner was clicked? Pin
0x3c020-Jun-09 2:45
0x3c020-Jun-09 2:45 
GeneralRe: How do I check whether the "X" button in the top right corner was clicked? Pin
Etienne_12321-Jun-09 11:52
Etienne_12321-Jun-09 11:52 
QuestionNeed Easy Insert Method Pin
M Riaz Bashir20-Jun-09 2:30
M Riaz Bashir20-Jun-09 2:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.