upload and execute a .SQL script to a web host to deploy a SQL database
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
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!
精彩评论