Click here to Skip to main content
15,922,166 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
I have a requirement that, Need to update the records in sql table based on sampling (i.e,assume, no of records=10 ,if sampling is 50% then 5 records need to update,if sampling is 70% then 7 records need to update using window service . ) using Entity Frame work

Kindly advise me how to implement in window service using C#

Am new to windows service & Entity frame work .Kindly guide me .How to take it forward.

Thanks in Advance,
Posted
Updated 17-Apr-15 0:28am
v4
Comments
Garth J Lancaster 16-Apr-15 8:21am    
what are the requirements that say you have to do this in a service ? nothings stopping you from doing so, except, you then have to write a program to control the service to change your sample parameters or such --- what's wrong with

a) a stored procedure (you can invoke this from a small exe started by (for example) the windows scheduler)

b) a batch program - again, started by a windows task scheduler

if you have no other choice but to write a service for some reason, I recommend you google for 'TopShelf' - that has all the plumbing/guts you need for a service.. if you need to do your update periodically, you can use TopShelf + Quartz.Net for scheduling, and, if you get the correct set of tools, you can set the environment up using Nancy/REST to keep and eye on the service/control it
Member 8058334 17-Apr-15 6:43am    
Lancaster, Thanks for the comments.
Based on the sampling grid, the charts having the status “Completed” will be automatically assigned to the mapped QA(Quality Analyst) user as per the Agent-QA mapping.
o Example: - if 50% is the sampling for a Agent and he has 10 charts then any 5 charts need to automatically allotted to QA person.
All charts should follow the coder-QA Mapping, QC Carry forward (TAT Exceed accounts) need to be allocated to the QA (automatically using Window service) based on the assigned date/discharge date following the coder-QA Mapping. Any absenteeism should be managed by auto alert to Quality Team leader and team leader will reallot those accounts manually to another QA user)

I'd suggest starting with the articles on this site, for example Creating a simple Windows Service[^].

The nice thing about .Net is no matter what kind of project you write, the C# will often be the same. So, create a Windows Service as a new project in Visual Studio and then write the code to access the db however you need to and then read through the article for how to debug and test it.
 
Share this answer
 
Code will remain same even in Windows Service. It is ultimately a console application only which deploys as a Windows service. So do your code and then put it in windows service.
Below are some links which will help you to how to create and deploy windows service.
Creating a Basic Windows Service in C#[^]
http://www.csharp-examples.net/install-net-service/[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900