How are you reading the file? StreamReader?
I use this pattern for line by line type of insert. It can be used to prep a
bulk load file. NOTE: if you are on SQL Server and set up a bulk load, you
can set it up to ignore a number of errors.
string line;
while(null != (line = reader.ReadLine()))
{
if(line.Trim().Length != 0)
{
ProcessLine(line);
}
}
--
Gregory A. Beamer
*************************************************
Think Outside the Box!
*************************************************
"John" <wh****@gmail.com> wrote in message
news:ek****************@TK2MSFTNGP04.phx.gbl...
I have a process that reads a text file then uploads the data into a
database table. The text file has 10 lines at the end of the file that are
blank BUT it appears that the enter key or space bar was hit so the code
thinks its lines of data and this is causing my process to fail. How can I
skip those lines and have my process continue and complete successfully?
this file is generated automatically for uploading and then supplied to me
for the upload process