By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,529 Members | 1,826 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,529 IT Pros & Developers. It's quick & easy.

Using OleDbConnection in Sharepoint WebParts gives System.Security.SecurityException

P: n/a
Hello,

Iam developing a sharepoint webpart which needs to read data from an excel
file.
Iam using OleDbconnection for reading data from excel.

However using OleDbconnection object gives the following error:

"Request Failed: System.Security.SecurityException."

no other error description is given.

Using SqlConnection does not give any error.

The assembly containing the webpart has fulltrust permissionset

can someone please help.

Thanks

Shreeram


Nov 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Shreeram,

I would guess that it really doesn't have fulltrust permissions,
otherwise, you should never get a SecurityException. The only thing I could
think of is maybe the current user (the one the web part is running under)
doesn't have rights to unmanaged code (since you are using an OLE DB
provider), or doesn't have rights to the file/location that you are trying
to read from.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Shreeram Natarajan" <mr**********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hello,

Iam developing a sharepoint webpart which needs to read data from an excel
file.
Iam using OleDbconnection for reading data from excel.

However using OleDbconnection object gives the following error:

"Request Failed: System.Security.SecurityException."

no other error description is given.

Using SqlConnection does not give any error.

The assembly containing the webpart has fulltrust permissionset

can someone please help.

Thanks

Shreeram

Nov 17 '05 #2

P: n/a
Hi,

Thanks for the reply.
Can you tell me how to assign rights to the current user (the one the web
part is running under)
for unmanaged code (OLE DB).
the assembly has rights to read the excel file.

Thanks

Shreeram

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:uH*************@TK2MSFTNGP11.phx.gbl...
Shreeram,

I would guess that it really doesn't have fulltrust permissions,
otherwise, you should never get a SecurityException. The only thing I
could think of is maybe the current user (the one the web part is running
under) doesn't have rights to unmanaged code (since you are using an OLE
DB provider), or doesn't have rights to the file/location that you are
trying to read from.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Shreeram Natarajan" <mr**********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hello,

Iam developing a sharepoint webpart which needs to read data from an
excel file.
Iam using OleDbconnection for reading data from excel.

However using OleDbconnection object gives the following error:

"Request Failed: System.Security.SecurityException."

no other error description is given.

Using SqlConnection does not give any error.

The assembly containing the webpart has fulltrust permissionset

can someone please help.

Thanks

Shreeram


Nov 17 '05 #3

P: n/a
Hi,

Thanks for the reply.
Can you tell me how to assign rights to the current user (the one the web
part is running under)
for unmanaged code (OLE DB).
the assembly has rights to read the excel file.

Thanks

Shreeram

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:uH*************@TK2MSFTNGP11.phx.gbl...
Shreeram,

I would guess that it really doesn't have fulltrust permissions,
otherwise, you should never get a SecurityException. The only thing I
could think of is maybe the current user (the one the web part is running
under) doesn't have rights to unmanaged code (since you are using an OLE
DB provider), or doesn't have rights to the file/location that you are
trying to read from.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Shreeram Natarajan" <mr**********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hello,

Iam developing a sharepoint webpart which needs to read data from an
excel file.
Iam using OleDbconnection for reading data from excel.

However using OleDbconnection object gives the following error:

"Request Failed: System.Security.SecurityException."

no other error description is given.

Using SqlConnection does not give any error.

The assembly containing the webpart has fulltrust permissionset

can someone please help.

Thanks

Shreeram


Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.