|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Can't access to a remote SQL Database through a web serviceI'm developing a web service in c#, and I can't make it access to a remote sql database. I entered the correct username and password into the connection string of the web service, but when I try to access to the db remotely I get the following exception: System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Security.SecurityException: Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. [...] Any help will be great! Thanks, Brian Brian,
First of all i assume you are developing on .NET 2.0-SQl Server 2005 Please check whether your assembly has any code-access Security. Then try exploring along the lines of the permissionset for your assemlbies. Please check the following link http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=75504&SiteID=17 Pls let me know if it's helpful -- Show quoteThanks & Regards, Mark Nelson "Brian Roisentul" wrote: > Hello, > > I'm developing a web service in c#, and I can't make it access to a > remote sql database. > > I entered the correct username and password into the connection string > of the web service, but when I try to access to the db remotely I get > the following exception: > > System.Web.Services.Protocols.SoapException: > System.Web.Services.Protocols.SoapException: Server was unable to > process request. ---> System.Security.SecurityException: Request for > the permission of type 'System.Data.SqlClient.SqlClientPermission, > System.Data, Version=2.0.0.0, Culture=neutral, > PublicKeyToken=b77a5c561934e089' failed. [...] > > Any help will be great! > > Thanks, > > Brian > > Hi Mark,
Thanks for your quick reply. I read the page you gave me and added the "context connection=true" to my connection string, but I don't understand some things... "...the error you mention is actually what you'd get if you tried to open a "regular" connection (non-context connection) while your assembly was registered in the "SAFE" secuirity bucket." by Pablo Castro He mentions that my assembly was registered in the "safe" security bucket. I don't understand where my assembly is registered...where is the "safe security bucket"? Thanks, Brian |
|||||||||||||||||||||||