Import Excel Problem in asp.net after hosting..

Posted by Gopal_nivas under ASP.NET on 10/12/2010 | Points: 10 | Views : 3171 | Status : [Member] | Replies : 2
hi..

i want to import excel sheet values to sqlserver

in localhost it is working fine for me.

but after hosting it shows the error like this"System.Data.OleDb.OleDbException: Unspecified error"

how to tackle this..

need ur suggestions and solutions..

regards
gopal.s




Responses

Posted by: Gopimalu on: 10/12/2010 [Member] Starter | Points: 25

Up
0
Down
Hi Gopal,

Can you post your code snippet which you used to do the above task?

Thanks,
Gopinath
Be Happy and Make Others Happy :-)

Thanks,
Gopinath
Be Happy and Make Others Happy :-)

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lalji_mer on: 10/13/2010 [Member] Bronze | Points: 25

Up
0
Down
Reason->1). ASP.NET/Impersonated account doesn't have enough privileges to create the ldb file.

Resolution:-> Give the ASP.NET user account create/write privileges to the folder where the excel/access file is placed. If you are using impersonation, give the impersonated account the said privileges.

Reason->2) .Impersonated account doesn't have enough privileges to create temporary files.

Resolution:->Give the impersonated account full access to the above mentioned folder. Fore Reference show this linkhttp://support.microsoft.com/default.aspx?scid=kb;EN-US;825738
http://support.microsoft.com/kb/825738
Note:-> When you open excel or access files using Jet, it requires creation of temporary files. Under ASP.NET, these files will be created under the C:\Documents and Settings\MachineName\ASPNET\Local Settings\Temp folder. By default, the ASP.NET user account is given full access to this folder. Now, when you are using impersonation, the impersonated account naturally wouldn't have access to this folder. Consequently, the Jet engine wouldn't be able to create the temporarily files while opening connections to excel or access files under ASP.NET. Due to this, the OleDb provider throws an exception with no specific message - System.Data.OleDb.OleDbException: Unspecified error.


LP MER

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response