Click here to Skip to main content
15,898,035 members

Comments by arunavachowdhury (Top 1 by date)

arunavachowdhury 10-Jul-20 18:01pm View    
Ok. I would try to explain in more detail.
I have one FileUpload control which allows multiple files to select and upload.
a command button which copies the posted file through FileUpload to a specified location.
Upto here everything works as expected.
Now I have the code written on the same command button to read the excel file which is copied.
The first file reads correctly.
while reading the second file it finds the same data.

Now to test it further. I have moved the file read code to a different command button. Now I did 2 tests.
Test 1. Upload 2 files using file upload
Click on command button 1 to copy the posted files to spefified location
click on Command button 2 to loop through the files on copied folder and read the
files.
Result: Same issue, reading second file it gets the same data.
Test 2:
Run the application. Do not select and upload any file. Manually copy the same to
files to the specified location.
click the command button 2 to read the files.
File reads correctly.

its very clear there is nothing wrong with the function to read files. When File Upload is working there must be some conflict in memory management. I wonder whats my alternative to the requirement.