You can not call window service in any project because it is not like class library.
I am not getting what are you doing with window service. Please explain what is is currently doing and what are you planning to do?
i want to insert records into a sqlTable for that i created a method with 4 arguments in windows services class.
inside that method i wrote code to insert those 4 arguments.
i installed this windows service.
from another project i want to call this method
To insert records from a form i called that service like this
WindowsService1.Service1 winService = new WindowsService1.Service1();<br />
winService.insertValues(txtcustId.Text, txtcustName.Text, txtcustPhone.Text, txtcustAddress.Text);
here insertValues is my method inside windows service, where i wrote insert statement.
is this correct way?
when i tried to build it is giving below error
Error 2 The type 'System.ServiceProcess.ServiceBase'is defined in an assembly that is not referenced. You must add a reference to assembly'System.ServiceProcess, Version=22.214.171.124, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. C:\Inetpub\wwwroot\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs 45113 WindowsFormsApplication1<br />
when am trying run this service from computer Mangement
is it displaying below alert
"The service on local machine started and stopped. some services stopped automatically if they have no work to do for example the performance logs and alerts service."
"The service on local machine started and stopped. some services stopped automatically if they have no work to do for example the performance logs and alerts service.
This error means there is some error in the code of your window service. You have not done any exception handling.Write Try/Catch block to catch the exception and log that error in event viewer or log file.
if you want to achieve this type of functionality than i suggest you to consider webservice.Using window service you will not achieve this. Moreover,there is no point to keep busy your server by making window service.
Ah ok, I guess we have PM's (Project Managers) but they don't get involved with how the thing is written, or Technical Lead's which do. Hence my confusion.
Anyway, he might have a valid reason for wanting to send all database communication through a windows service (ie, single point of caching) but he's obviously not been specific enough on how to communicate with this service for his more junior team members.
Last Visit: 31-Dec-99 18:00 Last Update: 13-Aug-22 22:57