Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
Hello guys,
I am really newbie to this concept. It is really my first question. I kinda know the basics about programmin still i am very new to SQL.
Ok,
now my question is. How may i update the values on a Table based on the changes that happen every 20sec for example in an CSV file controled by an other C# executive.

If i havent made myself clear. Please tell me so

Thank you.
Posted
Comments
[no name] 13-Jul-14 15:11pm    
Well a fairly simple way would be to implement a FileSystemWatcher and when that fires, update the database.

1 solution

I guess you could implement a Service that runs on your server


Walkthrough: Creating a Windows Service Application
[^]

(You can also create a simple console application that does the same job)

Then you can use the FileSystemWatcher
FileSystemWatcher Class[^]

However, there are some pitfalls.

FileSystemWatcher - Pure Chaos (Part 1 of 2)[^]

A simple way is to use a timer that fires every 20 seconds and calls a method that checks if there are any files available.
Timer Class[^]

Either way you have to decide if you should delete the file after processing, move it to another folder, etc.

I hope these links will help you along.
 
Share this answer
 
Comments
lari23 15-Jul-14 2:14am    
Thank you for your answer, it actually showed me a way still working on it. I am gonna be back for more details

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900