Link to home
Start Free TrialLog in
Avatar of chinu1310
chinu1310Flag for United States of America

asked on

Urgent - .NET Script for txt file to SQL table

Hello Experts.

I have the following problem.

I have some code which takes an input text file which is semi colon delimited. And converts it to SQL datatable.
The thing I want is to make this code as script so it will run every two hours.

The reason I want to do this is because the input text file will be updated every two hours. And I do not want to convert this txt to SQL manually. It should be automatic.

I have no idea how to achieve this? Is there a way I can create some script which will do this task ?
Open for any suggestions.

Hope I explained my question correctly.

Thank in advance

Avatar of tpwells
tpwells

Quickest solution:

Create your script to run as an exe that takes a command line parameter, namely the sql file path and name. Set up a scheduled task to execute every 2 hours calling that exe and passing the sql file as the parameter.

Second Solution:

Turn your script into a windows service that will execute the procedure every two hours based on a timer object in the code.
Avatar of chinu1310

ASKER

Gr8! What I am suspicious about is my application is web application. How can I manage any of the above ideas to match with that.

I liked you second idea. Can you be more specific on that. If it is applicable to web applications.
Thanks for reply.
ASKER CERTIFIED SOLUTION
Avatar of tpwells
tpwells

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial