Identity impersonate oledb connection in asp.net -
i have issue, in application trying upload excel data using oledb connection. code
if (fileextension == ".xls") { connectionstring = "provider=microsoft.jet.oledb.4.0;data source=" + filelocation + ";extended properties=\"excel 8.0;hdr=yes;imex=2\""; } else if (fileextension == ".xlsx") { connectionstring = "provider=microsoft.ace.oledb.12.0;data source=" + filelocation + ";extended properties=\"excel 12.0;hdr=yes;imex=2\""; } // create oledb connection , oledb command oledbconnection con = new oledbconnection(connectionstring); oledbcommand cmd = new oledbcommand(); cmd.commandtype = system.data.commandtype.text; cmd.connection = con; oledbdataadapter dadapter = new oledbdataadapter(cmd); datatable dtexcelrecords = new datatable(); con.open(); is working fine when using
<identity impersonate="false"/> but when using
<identity impersonate="true" username="domain\accountname" password="*****"/> the oledb connection throwing error, unspecified error.
can please me.
thanks
gulrej
you may want provide more details solution. impersonated user might not have access file.
impersonation issues versatile , without knowing specific configuration hard help.
also failure happens when access server locally or remotely. if succeeds locally fails remotely, may want assign spn asp.net app pool user account application.
check out article:
Comments
Post a Comment