Urgent - .NET Script for txt file to SQL table

Posted on 2007-07-24
Last Modified: 2013-12-17
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

Question by:chinu1310
    LVL 10

    Expert Comment

    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.
    LVL 14

    Author Comment

    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.
    LVL 10

    Accepted Solution

    Windows services will not work for web application unless you code your script as a service or create a esrvice that launches your page but if you are going to do that you would be better off to schedule a task to launch the web page when you want it to run.

    Two Tutorials that will help create a service:
    VS2005 Express:

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    In my previous two articles we discussed Binary Serialization ( and XML Serialization ( In this article we will try to know more about SOAP (Simple Object Acces…
    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now