c# uploading file - error -


I have a webpage where users can upload excel file. I'm trying 2 different files - works without a problem, and the other gives me this error:

Error: The length can not be less than zero. Parameter Name: Length

I know that sometimes this happens when the file size is zero, but this is not the case.

Can anyone put light on this issue? Please tell me that you need more information.

As stated, more information is required. It is not clear whether you are opening Excel file and processing it directly from it or data from data are read directly through ODBC, or something else.

Most of my problems in reading excel files are due to various types of data in column titles or in a particular column. First check to see that your two excel files have the same column, all the columns have names, etc.

When you read on a datatable, the program estimates on the data type of each column. If the first multiple cells are empty, the guess might be wrong. If your data is like me, such a column looks like this is the number of all the numbers half the actual number, half the wire. Or, there may be an invalid value in one column of dates.

Let me know the data from Excel one. To write in the CCV file, write the program schema.ini and it is a Microsoft text driver, but it may not be compatible with your data.


Comments