Click here to Skip to main content
14,835,749 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have excel sheet that contain data ,that data i want to store into sql database upon excelsheet upload from that aspx page using fileupload controls.i am trying to store data but get error as below

"The Microsoft Office Access database engine cannot open or write to the file ''. It is already opened exclusively by another user, or you need permission to view and write its data"

so pls any one help me.
and thanks in advance ...

1 solution

Without seeing your code it's almost impossible to say exactly what the problem is, but assuming you're saving the uploaded excel file to the hard drive, make sure you're closing the FileStream after saving:[^]

You can either call Close() explicitly, or wrap the FileStream in a using statement as it implements IDisposable

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900