my intention is to check a folder every so often and take the .txt files one by one and transfer the data in the text files into a sql server database table.
Should I use DTS within vb.net or some other means?
Thanks
Printable View
my intention is to check a folder every so often and take the .txt files one by one and transfer the data in the text files into a sql server database table.
Should I use DTS within vb.net or some other means?
Thanks
well the best way would be to use a file system watcher, whatever it's called....
It's just an object from a namespace that you will create, and basically whenever the contents of the directory change (creation, editing, deletetion, etc.) that you've subscribed your watcher to, the watcher will come back and tell you what has happened...
This is going to be a more efficient way of doing things than checking the directory at a timed interval...
http://www.vbforums.com/showthread.p...ectory+watcher
http://www.freevbcode.com/ShowCode.Asp?ID=4841
Well File system Watcher depends on if he wants to do something right when a change is made to a file or directory. He may want more of a scheduled task thing.
Hi Guys,
Thanks for the reply but I am really after the actual data transfer from a text file to a table in sql server.
Should I use DTS within vb.net or some other means?
More info please on or your situation in general. It the text file on the same comp as the database. Is it over a network? Do you want to schedule this. Are you using Com+ and Transactions?
Personally I like calling dts packages from SQL Stored procedures and calling the sprocs from my middle tier if you absolutly have to run one from your app. It gives you more options if the sheit hits the fan during data transfer. and keeps your data and business logic seperated like they should be in the first place.
If It is just a Database issue then Create the DTS Package on the database and Schedule it from there.