"Antonio Tirado" <An***********@discussions.microsoft.com> wrote in message
news:DC**********************************@microsof t.com...
(ASP.NET c# Question)
Hi, I have this odd problem:
I receive a CSV File through file upload. Using an OleDB.Datareader i read
each row of the file and insert it into SQL.
The problem is that for some reason when the file goes over 15k the
program
gets stuck. All rows are read and inserted correctly into SQL. The program
is
not generating duplicate entries. It is just there waiting for something
until the session expires.
I tried generating a Dataset and reading from there into SQL but the
result
is the same. Ialso tried saving the file into xml and reading from a
dataset
of this XML file but the result is the same.
Thanks in advance
I'm always amazed when someone uses an OleDB data reader to read a CSV file.
Why on earth would you do that? You don't get the control over error
handling that you would get if you simply read the data in a stream and
parsed it yourself. CSV is SO simple that it just doesn't make sense to use
an adapter, especially one that conforms to a database interface, to
interpret it for you.
The culprit is probably your data. If you have a double-quote in the data,
then your adapter is looking for a close quote. On the other hand, perhaps
you have no CRLF at the endof the last line, where the adapter is expecting
a CRLF at the end of the last line. Look at the data... it's probably the
culprit.
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--