2014-02-27 67 views
0

我有經典的asp.net網站,在VS的作品非常好,但是當我心中已經部署它aspspider.com它給出了一個錯誤 的錯誤是用戶沒有執行此操作的權限。當我部署我的網站

User does not have permission to perform this action. 

我想配置它出了什麼問題。 我也閱讀了許多關於在.webconfig中添加標籤或更改帳戶用戶權限的文章。我不知道這是什麼。

我不知道所有的信息分享,請讓我爲你想知道的信息,我將分享在這裏。

Exception Details: System.Data.SqlClient.SqlException: User does not have permission to perform this action. 

    [SqlException (0x80131904): User does not have permission to perform this action.] 
    System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5063578 
    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234 
    System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2275 
    System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35 
    System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) +183 
    System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +239 
    System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +195 
    System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +232 
    System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +5077239 
    System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +33 
    System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +524 
    System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 
    System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +479 
    System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +108 
    System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126 
    System.Data.SqlClient.SqlConnection.Open() +125 
    System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user) +43 
    System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe() +47 
    System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode() +20 
    System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) +57 
    System.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.Execute(Expression expression) +56 
    System.Linq.Queryable.FirstOrDefault(IQueryable`1 source) +265 
    Category.binddata(String loc) in c:\MemberSites\MemberSites_AspSpider_Ws\manishgor\webroot\Category.aspx.cs:172 
    Category.Page_Load(Object sender, EventArgs e) in c:\MemberSites\MemberSites_AspSpider_Ws\manishgor\webroot\Category.aspx.cs:20 
    System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 
    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 
    System.Web.UI.Control.OnLoad(EventArgs e) +91 
    System.Web.UI.Control.LoadRecursive() +74 
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207 

這裏是我的webconfig文件

<?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="ManishString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\PrimaryDatabase.mdf;Integrated Security=True;User Instance=True" 
    providerName="System.Data.SqlClient" /> 
     <add name="PrimaryDatabaseConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\PrimaryDatabase.mdf;Integrated Security=True;User Instance=True" 
    providerName="System.Data.SqlClient" /> 
</connectionStrings> 
<system.web> 

     <compilation debug="true" targetFramework="4.0"> 
      <assemblies> 
       <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation> 
    </system.web> 
</configuration> 

我使用Windows身份驗證連接到我的數據庫。

回答

0

你有沒有輸入正確的連接字符串?

添加名稱= 「PrimaryDatabaseConnectionString」 的connectionString = 「數據源= \ SQLEXPRESS; AttachDbFilename = | DataDirectory目錄| \ PrimaryDatabase.mdf;集成安全性=真;用戶實例=真」 的providerName = 「System.Data.SqlClient的」

從上面的錯誤消息,看來問題是許可。在共享主機上,您需要獲得許可才能執行此任務,並且您需要詢問您的主機提供商。在本地計算機上運行它是不同的。

0

其實,解決的辦法是正確的,在aspspider.com的論壇。 Aspspider.com不會自動附加app_code文件夾中的數據庫,而是我們必須自己附加數據庫並根據aspspider.com的論壇更正連接字符串。

如果你正面臨着aspspider.com同樣的問題,請檢查AspSpider.com的論壇的都在那裏提到並沒有在本地使用VS.上創建的數據庫更改用戶權限的任何要求

我希望有一天這將有助於有人出來!

相關問題