I accidentally overwrote all the data in a column of one of my tables with a bad SQL command, and now want to rebuild the table with data from a text file. The table is just an Id field (auto generated primary key), and a column for "Name". At runtime, I'd simply like to take each value in my text file, and insert it into the "Name" field of my table.
I've read a bunch of tutorials on using the System.IO.StreamReader object to read files, but can never get anything to work. The project can't find my file, or I get other errors that I can't decode even after I copy the code verbatim. Here are a couple I looked at:
http://aspnet.4guysfromrolla.com/articles/051802-1.aspx
http://msdn.microsoft.com/en-us/library/system.io.streamreader.aspx
It's one small text file with a value on each line, and I just want to create a table record for each. Any help would be GREATLY appreciated!
...
Go to the complete details ...