Multithreading/Database Polling in Windows Service

Poll database table, looking for items to process
Queuing items for processing
Process files on disk (the database table being polled describes the files being processed (file path, processing status))
Record processing results to database

The processing time for each item is assumed to take a long time (hours), so processing should take place on its own thread and multiple items should be processed concurrently (though probably not all items in the queue if the queue has a lot of items).

I'm not an expert
Who is Participating?
AFIF JABADOAuthor Commented:
the procces who i can do this ? using c# and thread ..
u can take a look for this code

this my first time on windows app and i want to write a service can read and process record from table

and after finish it i repeat the job again using c# ?

and if the code is that why i need tell me where i will insert my  sql connection and add begin transaction
Julian HansenCommented:
What's the question?
Julian HansenCommented:
Ok so what you are are asking is for someone to provide the code that does the above - is that correct?

It seems the basics are in the CodeProject article - what is missing that you need?
AFIF JABADOAuthor Commented:
what i need is i have a table on database where i store on it  all task added by user from web applicaitonn

so my application should be run as windows service and do the task
the task is

some sql query
select the record update status of record to begin processing
insert data on new table
select some record and post to an url

use transaction on query if the sql query didn\t committed rollback it to original state
to re process it again..

when i finish and my all my query and post url .. update the status to DONE
to prevent read it again ..

than i want to repeat this jobs when he finish

1- run windows service
2- do a job
3- wait sleep 30 second
4- repeat the same job

because the job it will select record from the database

and my table all time i have new record !!
AFIF JABADOAuthor Commented:
still now i didn't get any solution maybe no one understand what i mean with my question and still now i don't need to solve it because is too late
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.