Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Getting error while displaying database table data

  Asked By: Ganesh    Date: Jan 26    Category: Sharepoint    Views: 1639

I am trying to display database table data onto the sharepoint site using
datagrid as explained in the following link but i am getting following


System.Security.SecurityException: Request for the permission of type
'System.Data.SqlClient.SqlClientPermission, System.Data, Version=,
Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. at
System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark&
stackMark, Boolean isPermSet) at System.Security.PermissionSet.Demand() at
System.Data.Common.DbConnectionOptions.DemandPermission() at
System.Data.SqlClient.SqlConnection.PermissionDemand() at
outerConnection) at
outerConnection, DbConnectionFactory connectionFactory) at
System.Data.SqlClient.SqlConnection.Open() at
GetDataRender.WebPart1.RenderWebPart(HtmlTextWriter output) in C:\Documents and
Settings\Administrator\My Documents\Visual Studio
2005\Projects\GetDataRender\GetDataRender\WebPart1.cs:line 93 The action that
failed was: Demand The type of
the first permission that failed was: System.Data.SqlClient.SqlClientPermission
The Zone of the assembly that failed was: MyComputer


Has anybody tried it out or any other solution or better approach for this



2 Answers Found

Answer #1    Answered By: Kundan Jambhale     Answered On: Jan 26

Check the trust level on your site's Web.Config file.

Answer #2    Answered By: Alyssa Butler     Answered On: Jan 26

This may cause because the user name/password that ur trying to access database
don't have enough permissions.

Didn't find what you were looking for? Find more on Getting error while displaying database table data Or get search suggestion and latest updates.