CSV file > database using ASP.NET?

Associate
Joined
18 Dec 2007
Posts
209
Hi All

I've got a rather large CSV file that is continually updating. It's currently at around 1000ish rows.

I'd like to create a script in ASP.NET using VB ? that will read the records directly into a database. I can then run this when the csv updates.

What's the best way of doing this? I keep reading about BULK insert, but when i try to do this I get an error somewhere along the lines of you not being able to use! (On laptop at the moment and don't have access to the files)

I'm using VS2008 and SQL 2005 express so any tips would be greatly appreciated. I guess I could read them into a dataset then update the database manually but this sounds really inefficient!

Regards
 
Ok i would use a dataset and make the SQL insert statement in there. In the main script of the program read in the file, and check for changes. Take the new rows and insert them. Of course you could put this all in a thread and have the program run every 5 mins so you wouldn't have to do it manualy.
 
Thanks for the reply.

Ended up using DTC within SQL Enterprise manager to upload the CSV. It creates a routine which by the looks of things I can configure to run regularly when the data is updated.

Will have another look on Monday!
 
Back
Top Bottom