首页 文章

为什么我无法在网页上访问我的数据库?

提问于
浏览
1

我的网络项目出错了 . 我有一个aspx网站,其中有一个页面,我用它来查看个人黑胶唱片集的数据库 . 我使用visual studio 2013 Professional来创建整个站点和数据库 . 当我在Chrome测试浏览器中运行项目时,它运行得非常好,但是当我发布它并在合法的Web浏览器上运行它时,我得到以下错误 . 我试过谷歌搜索问题,然后空了 . 有人能指出我需要去的方向吗?我是否需要更改web.config文件中的访问权限或信任级别?我究竟会在配置文件中添加什么?

链接:http://gipetransmissions.com/DBWebPage.aspx

配置文件:

<?xml version="1.0"?>

<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>

    <connectionStrings>
        <add name="ConnectionString" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\JWVinylDB.mdf;Integrated Security=True"
            providerName="System.Data.SqlClient" />
    </connectionStrings>
    <system.web>

      <customErrors mode="Off"/>
      <compilation debug="true" targetFramework="4.5" />
      <httpRuntime targetFramework="4.5" />
    </system.web>

</configuration>

错误:

'/'应用程序中的服务器错误 . 安全异常说明:应用程序尝试执行安全策略不允许的操作 . 要授予此应用程序所需的权限,请与您的系统管理员联系或在配置文件中更改应用程序的信任级别 . 异常详细信息:System.Security.SecurityException:请求失败 . 源错误:[无相关源代码行]源文件:App_Web_ahkwuo05.2.cs行:0堆栈跟踪:[SecurityException:Request failed . ] System.Security.CodeAccessSecurityEngine.Check(Object demand,StackCrawlMark&stackMark,Boolean isPermSet)0 System . Security.CodeAccessSecurityEngine.Check(PermissionSet permSet,StackCrawlMark&stackMark)31 System.Security.PermissionSet.Demand()68 System.Data.LocalDBAPI.DemandLocalDBPermissions()241 System.Data.LocalDBAPI.CreateLocalDBInstance(String instance)32 System.Data.SqlClient .TdsParser.Connect(ServerInfo serverInfo,SqlInternalConnectionTds connHandler,Boolean ignoreSniOpenTimeout,Int64 timerExpire,Boolean encrypt,Boolean trustServerCert,Boolean integratedSecurity,Boolean withFailover)5308411 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo,String newPassword,SecureString newSecurePassword,Boolean ignoreSniOpenTimeout,TimeoutTimer timeout,Boolean withFailover)145 System.Data.SqlClient . SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo,String newPassword,SecureString newSecurePassword,Boolean redirectedUserInstance,SqlConnectionString connectionOptions,SqlCredential credential,TimeoutTimer timeout)262 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout,SqlConnectionString connectionOptions,SqlCredential credential,String newPassword,SecureString newSecurePassword ,Boolean redirectedUserInstance)307 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity,SqlConnectionString connectionOptions,SqlCredential credential,Object providerInfo,String newPassword,SecureString newSecurePassword,Boolean redirectedUserInstance,SqlConnectionString userConnectionOptions)434 System.Data.SqlClient.SqlConnectionFactory.CreateConnection (DbConnectionOptions选项,DbConnectionPoolKey poolKey,Object poolGroupProviderInfo,DbConnectionPool池,DbConnection owningConnection,DbConnectionO ptions userOptions)225 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool池,DbConnectionOptions选项,DbConnectionPoolKey poolKey,DbConnectionOptions userOptions)37 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnectionOptions userOptions)321 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest (DbConnectionOptions userOptions)67 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject,UInt32 waitForMultipleObjectsTimeout,Boolean allowCreate,Boolean onlyOneCheckConnection,DbConnectionOptions userOptions,DbConnectionInternal&connection)1052 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject,TaskCompletionSource1 retry, DbConnectionOptions userOptions,DbConnectionInternal&connection)78 System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection,TaskCompletionSource1 retry,DbConnectionOptions userOptions,DbConnec onInternal&connection)167 System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection,DbConnectionFactory connectionFactory,TaskCompletionSource1 retry,DbConnectionOptions userOptions)143 System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 retry)83 System.Data.SqlClient.SqlConnection.Open ()96System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,DataTable [] datatables,Int32 startRecord,Int32 maxRecords,String srcTable,IDbCommand command,CommandBehavior behavior)121 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet,Int32 startRecord, Int32 maxRecords,String srcTable,IDbCommand命令,CommandBehavior行为)316 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet,String srcTable)86 System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments)1482 System.Web . UI.DataSourceView.Select(DataSourceSelectArguments arguments,DataSourceViewSelectCallback callback)21 System.Web.UI.WebControls.DataBoundControl.PerformSelect()138 System.Web.UI.WebControls.BaseDataBoundControl.DataBind()30 System.Web.UI.WebControls.GridView .DataBind()4 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()105 System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls()75 System.Web.UI.Control.EnsureChil dControls()83 System.Web.UI.Control.PreRenderRecursiveInternal()42 System.Web.UI.Control.PreRenderRecursiveInternal()155 System.Web.UI.Control.PreRenderRecursiveInternal()155 System.Web.UI.Page.ProcessRequestMain( Boolean includeStagesBeforeAsyncPoint,Boolean includeStagesAfterAsyncPoint)6704 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint,Boolean includeStagesAfterAsyncPoint)245 System.Web.UI.Page.ProcessRequest()72 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)21 App.Web_ahkwuo05.2.cs中的System.Web.UI.Page.ProcessRequest(HttpContext context)58 ASP.dbwebpage_aspx.ProcessRequest(HttpContext context):0 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()341 System .Web.HttpApplication.ExecuteStep(IExecutionStep step,Boolean&completedSynchronously)69版本信息:Microsoft .NET Framework版本:4.0.30319; ASP.NET版本:4.0.30319.34249

1 回答

相关问题