473,473 Members | 2,357 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Using OleDbConnection in Sharepoint WebParts gives System.Security.SecurityException

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
3 2744
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
1
by: Sam | last post by:
I have a desktop VB.Net application I developed locally. I uploaded it to a file server we have and the .Net Framework is installed on the file server. When I try to run the executable from the...
2
by: Robert A. van Ginkel | last post by:
I have a strange C# problem. Is the following a bug? Because it should be possible to run unsafe code. How can I accomplish this? And where can I read more about this, because documentation on this...
2
by: MFRASER | last post by:
I am getting a System.Security.SecurityException when I try and laod a dataset from an xml file any ideas on what would cause this? System.Security.SecurityException' occurred in mscorlib.dll ...
1
by: edge | last post by:
hi, here it is my problem. My console app, reads a text file where it grabs username/password. Next, my app creates a .BAT file to trigger the command ftp:\\user:password@ftphomeaddress. ...
4
by: Peter | last post by:
Hi! I'm developing components (webparts) for a sharepoint site and are currently having some problems with the resource manager. The site supports two languages (English and Swedish) and when...
4
by: Abel | last post by:
Hi I try to execute an sample how to read and write excel sheets using OleDb When opens the connection, the objConn.Open gave me this error: "Request for the permission of type...
0
by: Eugene Anthony | last post by:
The problem with my coding is that despite removing the records stored in the array list, the rptPages repeater control is still visible. The rptPages repeater control displayes the navigation...
1
by: tagg3rx | last post by:
Hi all, I'm trying to figure out how to facilitate a window in my web application that will allow users to drag and drop files into it which will inturn trigger the files being uploaded to my...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.