我有经典的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 :(得分:0)
您输入了正确的连接字符串吗?
add name =“PrimaryDatabaseConnectionString”connectionString =“Data Source =。\ SQLEXPRESS; AttachDbFilename = | DataDirectory | \ PrimaryDatabase.mdf; Integrated Security = True; User Instance = True” providerName =“System.Data.SqlClient”
从上面的错误消息,似乎问题是权限。在共享主机上,您需要获得执行任务的权限,您需要询问您的托管服务提供商。在本地计算机上运行它时会有所不同。
答案 1 :(得分:0)
实际上,解决方案就在aspspider.com的论坛中。 Aspspider.com不会自动附加app_code文件夹中的数据库,而是我们自己附加数据库并根据aspspider.com的论坛更正连接字符串。
如果您遇到与aspspider.com相同的问题,请检查AspSpider.com论坛中所有提及的内容,并且不需要更改使用您的VS本地创建的数据库的用户权限。
我希望有一天这会帮助那里的人!