Visuall StudioでF5キーを押してテストすると正常に動作し、WebページとSQLクエリプロセスが正常に動作するようログインできます。また、私のSQLサーバーは、IPアドレスを使ってアクセスできるインターネット上でアクティブであることにも注意してください。ASP.NET [Win32Exception(0x80004005):アクセスが拒否されました]エラー
しかし、ASP.Net Webサイトをmyasp.netホスティングサービスプロバイダに公開すると、ログイン画面がうまく機能しています。しかし、問題は、私がVSでテスト中に発生していない以下のエラーを取得しているログインボタンをクリックしたときです。あなたがウェブ-configファイルに正しいログイン資格情報を使用している
Server Error in '/' Application. Access is denied Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ComponentModel.Win32Exception: Access is denied
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[Win32Exception (0x80004005): Access is denied]
[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - Access is denied.)]
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling) +1005
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) +799
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) +38
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +726
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +85
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +449
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +108
1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) +942
System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource
System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) +143
1 retry, DbConnectionOptions userOptions) +17
System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource
System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource1 retry) +139
1 retry) +367 System.Data.SqlClient.SqlConnection.Open() +129
System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource
UserLogin_VB.Login.ValidateUser(Object sender, EventArgs e) +220
System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +109 System.Web.UI.WebControls.Login.AttemptLogin() +119
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +75 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +120
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +166
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +31 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3450
接続文字列が正しい場合は、ファイアウォールの問題である必要があります。 –
あなたのプロバイダがあなたのようなプライベートSQLにアクセスすることを許可しないと思います。その場合、asp.netプロバイダがホストしサポートしているsqlを使用する必要があります。 – Asken
@Dr。ステッチ4、SQL接続部分とファイアウォールは完璧です。私のWindowsベースのexeは、IPアドレスでSQLサーバを接続することによって、異なる場所で同じ接続文字列で正常に動作しているからです。その他の提案はありますか? – Sixthsense