views:

33

answers:

1

Hi, I tried to upload a .SQL file to a Hoster and Execute it to Deploy a SQL Database following the steps outlined in Scott Guthrie's tutorial.

When I try to view the page, I am getting an error page. What's the root cause, and how can this be fixed?

Opening url http://www.elhayesetal.com/New_Members_ASPNETDB.MDF.sql  
   An error occured: System.Security.SecurityException: 
   Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. 
    at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) 
    at System.Security.CodeAccessPermission.Demand() 
    at System.Net.HttpWebRequest..ctor(Uri uri, ServicePoint servicePoint) 
    at System.Net.HttpRequestCreator.Create(Uri Uri) 
    at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase) 
    at System.Net.WebRequest.Create(String requestUriString) 
    at ASP.runsql_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) 
The action that failed was: Demand 
The type of the first permission that failed was: System.Net.WebPermission 
The Zone of the assembly that failed was: MyComputer 
A: 

As the exception details describe, it's a security and permissions problem.

Likely your solution will be to ensure your code is running in Full Trust mode.

One solution would be to modify your web.config file.

 <system.web> 
    <trust level="Full" originUrl="" />
 </system.web> 

This solution might require an IIS reset!

p.campbell