Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. : Sharepoint
This is a discussion on Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. within the Sharepoint forums in Microsoft Tools category; hi there i created a small hello.aspx page with a text box and buton to write texbox values to database pubs andi deployed this page in layouts folder. http://server/-layouts/hello.aspx . i can browse the content of the pages, when i fill the textbox and submit the button i get this error. Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. my code Imports System.Data.SqlClient Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim y As String = TextBox1.Text.ToString Dim myConnectionString As String = "Initial Catalog=pubs;Data Source=janu\sql;Integrated Security=True;" Dim myConnection As New SqlConnection(myConnectionString) Dim ...
| Sharepoint Microsoft sharepoint portal server development, administration and related discussions |
![]() |
| | LinkBack | Thread Tools |
|
#1
| |||
| |||
| i created a small hello.aspx page with a text box and buton to write texbox values to database pubs andi deployed this page in layouts folder. http://server/-layouts/hello.aspx. i can browse the content of the pages, when i fill the textbox and submit the button i get this error. Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. my code Imports System.Data.SqlClient Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim y As String = TextBox1.Text.ToString Dim myConnectionString As String = "Initial Catalog=pubs;Data Source=janu\sql;Integrated Security=True;" Dim myConnection As New SqlConnection(myConnectionString) Dim myInsertQuery As String = "INSERT INTO Schedule (username) Values ('" & y & "')" Dim myCommand As New SqlCommand(myInsertQuery) myCommand.Connection = myConnection myConnection.Open() myCommand.ExecuteNonQuery() myCommand.Connection.Close() End Sub cannot get this button to work. any help is appreciated. thanks gmail |
|
#2
| |||
| |||
| The application pool aslo has db owner permision to pubs. thanks sunil |
|
#3
| |||
| |||
| 7/12/2007 Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. Cause: Anything that access database from SP requires at least the WSS_Medium security policy in the web.config file. If you receive a security message from the web part, it's usually the trust element in the web.config file. Fix: Open wss_mediumtrust.config & wss_minimaltrust.config usually (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\config\) look in your web.config file for the exact path. Find in wss_mediumtrust.config: <SecurityClass Name="SqlClientPermission" Description="System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> Copy and paste it in to the <SecurityClasses> node of wss_minimaltrust.config. In the PermissionSet section of this configuration file, add the following: Find in wss_mediumtrust.config: <IPermission class="SqlClientPermission" version="1" Unrestricted="true"/> Copy and paste it in to the a <PermissionSet> node of wss_minimaltrust.config. That about covers it. On Aug 3, 2:31 pm, gmail001 <abcsu...@yahoo.com> wrote: > The application pool aslo has db owner permision to pubs. > thanks > sunil |
|
#4
| |||
| |||
| I got same prob..... change C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\CONFIG ------ wss_mediumtrust.config and wss_minimaltrust.config got answer................... thanks Ray Proffitt |
![]() |
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Request for permission of type System.Security.Permission.SecurityPermission,mscorlib failed | usenet | Sharepoint | 1 | 11-25-2007 12:54 PM |
| The BreadCrumb, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3925271131d1d367 | usenet | Sharepoint | 1 | 09-06-2007 07:36 AM |
| Enterprise Library error: Request for the permission of type System.Data.SqlClient.SqlClientPermission | usenet | DOTNET | 1 | 07-31-2007 11:17 PM |
| Enterprise Libray error: Request for the permission of type System.Data.SqlClient.SqlClientPermission | usenet | DOTNET | 0 | 07-27-2007 01:50 PM |



