Windows Service or Schedule Task
Hi,
I would like to have an automated process which does the following:-
[1] Connect to SQL Server
[2] Select FTP data (host, username and password) and "time to pull data" from a table
[3] Based on the "time to pull data" (say example 6:00am), it should connect to the FTP server using the selected FTP data
[4] Download all the files available in the FTP server to the local system.
[5] And this process should be executed continuously since, the step [2] will select more than one row with different FTP data and it's corresponding "time to pull data".
Having said the above requirements, my clarification is:-
[1] Should I use Windows Service or Schedule Task
[2] If "Windows Service" then how can the above requirement will be achieved, that is connecting to database, pulling data, connecting FTP as a said point of time, downloading available data to local system and the process round the clock?
[3] If "Schedule Task" then how can I develop modules task for "Schedule Task" using .Net and integrate that module in "Schedule Task".
Your timely guidance with sample code will be highly appreciated.
Mohandas K
Answers (4)
1
Try to give Session value before insert like below.
- try
- {
- Session["Vechilevalue"]=DropDownList1.SelectedValue;
- if(Session["Vechilevalue"]!=null&&!n.tbl_Vec.Any(x=>x.Vec_ID==Vec_ID))
- {
- v.Vec_ID=Vec_ID;
- {
- v.Vec_ID=DropDownList1.SelectedValue;
- }
- n.tbl_Vec.Add(v).ToString();
- n.SaveChanges();
- }
- else
- {
- }
- }
- catch
- {
- }