4
Answers

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
Photo of Ramesh Palaniappan
NA 13.2k 722.6k 8y
Try to give Session value before insert like below.
  1. try
  2. {
  3. Session["Vechilevalue"]=DropDownList1.SelectedValue;
  4. if(Session["Vechilevalue"]!=null&&!n.tbl_Vec.Any(x=>x.Vec_ID==Vec_ID))
  5. {
  6. v.Vec_ID=Vec_ID;
  7. {
  8. v.Vec_ID=DropDownList1.SelectedValue;
  9. }
  10. n.tbl_Vec.Add(v).ToString();
  11. n.SaveChanges();
  12. }
  13. else
  14. {
  15. }
  16. }
  17. catch
  18. {
  19. }