Re: Giving a webpart database access

From: Amar Galla (amarsos_nospam_at_yahoo.com)
Date: 03/01/05


Date: Tue, 1 Mar 2005 14:18:01 +0530

Ideally all you need to access database from a WebPart is the WSS_Medium
trust level. It will not work under Minimal trust level. Check if its a
trust issue or something else, but temporarily boosting the trust level to
Full. If it does not work, then check if you can access the database from
the machine where SPS is running supplying the login credentials you have
used in the code.

You can also check your database access code by temporarily testing it thru
a console app or a asp.net app. There is no big difference between ways to
access database from other apps compared to WebParts.

-- 
Hope this helps.
Regards,
Amar Galla
http://www.dotnetjunkies.com/weblog/amar/
"The Colonel" <colonelangus@budweiser.com> wrote in message
news:1109629895.936635.5350@z14g2000cwz.googlegroups.com...
> I have Office SPS 2003 and have created a strongly-named VB.NET webpart
> that works until I want to add any database access (local SQL server or
> using a DSN).  I get the generic "Problem with webpart" error, but with
> debug=true and CallStack=True in web.config, I get
> "System.Security.SecurityException: Request failed."
>
> So I read up on setting the security level to WSS_Medium, looked at
> that "code access security for developers" document, added
> "AllowPartiallyTrustedCallers" to my AssemblyInfo.VB, but it's still
> not working and I'm just not getting my head around it.
>
> Isn't there a step-by-step for this?
>


Relevant Pages

  • Re: Giving a webpart database access
    ... I had this same problem and the full trust worked as an interim solution, ... It will not work under Minimal trust level. ... then check if you can access the database from ... > a console app or a asp.net app. ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: Web Parts Instances
    ... interface with database record. ... editor webpart with database record. ... multiple editor webpart instances on a page and each of them should map ... To answer your question first, Yes, UniqueID is a unique identifer ...
    (microsoft.public.dotnet.framework.aspnet)
  • problem with IListSource does not contain data source!!
    ... datagrid, when deploying my webpart, i receive the message: ... Description("The database where the Enterprise Data is located.")] ... public string DataBase ... protected override void CreateChildControls() ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: question(s) about integrating the document library
    ... You need to use WebPart connections, you'll find a tonne of information ... I wish to set up my own relational database using SQL server. ... I intend to write a webpart that supplies a summary of the master ... separate folder for each master record, since the user might wish to ...
    (microsoft.public.sharepoint.portalserver)
  • Re: Urgent: Error While deploying ASP.net application
    ... Actually I am using MySQL database using MySQL ODBC 3.51 Driver. ... I think the trust level medium does not allow database interaction through ... > set the trust level to medium on your development machine to figure out what ...
    (microsoft.public.dotnet.framework.aspnet.security)