How to create a console application using vb.net and schedule using task scheduler
I need to create a console application which should be scheduled using task scheduler using vb.net. That program will read the content from some files and update the database, move the files and create a log file.
Kindly suggest me how to do the same and provide some examples if available.
Its all pretty straight forward. If you are using sql server you can do a remote db update, since this is a server db, just include the password and username in the connection. Then do the updating. To put it through the tash scheduler you just go to start -> programs -> accessories -> system tools -> scheduled tasks then you click on add a task and pick your exe out. When the exe is done executing kill it.
Providing some sample codes with file transaction (read,append,move,create a log file) and database transaction (updating) will be appreciated.
Pls provide if any URLs.
http://aspnet.4guysfromrolla.com/articles/072303-1.aspx this is more geared for asp.net, but here you go. Keep in mind that you can do just about anything you did in vb6 with vb.net the same way.
ps: Your log file is just going to be a basic text file correct? I have never seen a log file that has not just been a basic text file.... If you want to make it snazzy you can try writing it in the w3c format with the dates and software vers etc.
To update the db you are going to just use an sql statement I would imagine (I do not use vb.net for executables), but I mean you can just update an sql server db as if it were on the same box, you just need to use the url port pass and name etc. To move the files I would imagine you would need system.net.sockets. You might need to send this through ftp protocol or something otherwise the server might not like it too much.
Actually I need to create a console application. It will run from command prompt.
The file is to read a text file. It has two folder names. One in input folder and another one is output folder.
This file should read log files(text content) from input folder and based on each line in the file, it should update some tables in the database (Used by vb.net project).
After that and move the log file(text format) to output folder.
Then the program will start reading the next log file inside the Input folder. This process continues until there is no files inside Input folder.
Hope this is clear
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)