2017-01-24 5 views
0

スタンドアロンWindows 2008サーバーから、他のいくつかのWebアプリケーションの運用環境にある2012 R2サーバーに古いWebアプリケーションを移動しようとしています。接続文字列がSQL Serverに接続するときにエラーが発生する

専用のSQL Server 2012にSQL Serverデータベースを移動し、アプリケーションの接続と管理のためのドメインユーザーを設定しました。私は以下のエラーが表示され続けますが、なぜユーザーが接続できないのか分かりません。

<add name="CslaExConnection" 
    connectionString="Database=Databasev3;Server=Server\Instance,50000;User=Domain\User;[email protected];Enlist=false;" 
    providerName="System.Data.SqlClient" /> 
<add name="ConnectionString" 
    connectionString="Data Source=Server\Instance,50000;Initial Catalog=Databasev3;Persist Security Info=True;User ID=Domain\User;[email protected]" 
    providerName="System.Data.SqlClient" /> 
<add name="ConnectionString1" 
    connectionString="Data Source=Server\Instance,50000;Initial Catalog=Databasev3;Persist Security Info=True;User ID=Domain\User;[email protected]" 
    providerName="System.Data.SqlClient" /> 
<add name="Tools" 
    connectionString="Data Source=Server\Instance,50000;Initial Catalog=Databasev3;Persist Security Info=True;User ID=Domain\User;[email protected]" 
    providerName="System.Data.SqlClient"/> 
<add name="MySQLConnection" 
    connectionString="Server=127.0.0.1;Database=MySQLDB;Uid=root;[email protected];Port=3306;Allow Zero Datetime=True;" 
    providerName="MySql.Data.MySqlClient"/> 
<add name="CslaExConnectionSynergyContact" 
    connectionString="Database=goldmine;Server=Server\Instance,50000;User=Domain\User;[email protected];Enlist=false;" 
    providerName="System.Data.SqlClient" /> 
<add name="ConnectionString2" 
    connectionString="Data Source=Server\Instance,50000;Initial Catalog=Databasev3;Persist Security Info=True;User ID=Domain\User;[email protected]" 
    providerName="System.Data.SqlClient"/> 

そして、これは私がアプリケーションにログインしたときに、私は受信エラーです:

Server Error in '/md3' Application.

Login failed for user 'domain\user'.

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.Data.SqlClient.SqlException: Login failed for user 'domain\user'.

Source Error:

Line 45: PagingListFilter filter = new PagingListFilter(info);
Line 46: filter.PageSize = 0;
Line 47: GenericPagedList list = appUser.GetList(filter);
Line 48: DataTable dt = list.Results;
Line 49: if (dt.Rows.Count > 0)

Source File: d:\HTTP\wwwroot\synergytools\md3\loginold.aspx.cs Line: 47

Stack Trace:

[SqlException (0x80131904): Login failed for user 'domain\user'.] System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +428 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117 System.Data.SqlClient.SqlConnection.Open() +122 DFramework.Database.Query.ExecutePagedCommand() in D:\DCPL\Framework\DFramework\Database\Query.cs:508

[QueryException: SELECT COUNT(*) FROM (SELECT * FROM vwAppUserList 

WHERE OldUserId = @OldUserId 
) count__Query 
@OldUserId = 111 
] 
    DFramework.Database.Query.ExecutePagedCommand() in D:\DCPL\Framework\DFramework\Database\Query.cs:560 
    DFramework.Business.BusinessBase.ListData(Query query) in D:\DCPL\Framework\DFramework\Business\BusinessBase.cs:495 
    DFramework.Business.BusinessBase.List(Query query) in D:\DCPL\Framework\DFramework\Business\BusinessBase.cs:187 
    DFramework.UI.BusinessBase`1.GetList(PagingListFilter filter) in D:\DCPL\Framework\DFramework.UI\BusinessBase.cs:73 
    loginold.GetAppUserId(Int32 oldUserId) in d:\HTTP\wwwroot\synergytools\md3\loginold.aspx.cs:47 
    loginold.Page_Load(Object sender, EventArgs e) in d:\HTTP\wwwroot\synergytools\md3\loginold.aspx.cs:22 
    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) +99 
    System.Web.UI.Control.LoadRecursive() +50 
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627 

Version Information: Microsoft .NET Framework Version:2.0.50727.8009; ASP.NET Version:2.0.50727.8015

+0

ユーザーに接続する権限がありますか?彼らはデータベースにアクセスできますか?実際に設定ファイルに同じ接続文字列が7回あるのですか?または投稿の詳細を難読化するだけですか? –

+0

SQL Serverのエラーログには、ログインが失敗した理由(具体的には、メッセージテキストとエラーメッセージの「状態」番号)に関する詳細情報が含まれている必要があります。 –

答えて

0

KayZak、

SQL Serverの認証済みログインのように扱うために起こっているので、あなたは、接続文字列にドメインユーザーアカウントとパスワードを指定することはできません。したがって、ドメインユーザーアカウントを使用してアプリケーションを実行している場合、接続文字列は次の形式になります。

Data Source=myServerAddress;Initial Catalog=DataBase;Integrated Security=SSPI; 
+0

ああ、ありがとう。ユーザーを指定しないと、アプリケーションが特定のWindowsドメインユーザーを使用していることを確認するにはどうすればよいですか? – KayZak

+0

@KayZak .udlファイルでテスト接続を行うことができますが、 "Windows認証"を使用すると、ユーザーはアプリケーションを実行するユーザーになります。 – M84

+0

M56が正しいです。 IISを使用しているという前提の下では、アプリケーションのWindows認証を有効にし、アプリケーションをドメインアカウントとして実行するように設定する必要があります。ドメインアカウントのログインがSQL Serverに追加され、アプリケーションのデータベースにマップされていることを確認します。 – JAY

0

することができます

これらは機密情報に変更との接続文字列ですサーバーの接続を確認し、デスクトップに空のファイルを作成して保存します。.udl e xtension。今すぐ開いて、接続を作成してテストすることができます。

終了したら、メモ帳で.udlファイルを開くと、文字列の接続が表示されます。ドメインアカウントを使用している場合は、「integrated security = SSPI」を使用してください。 link .udl

・ホープ、このヘルプ:ここ

あなたは.UDLファイルで作成するためのチュートリアルとテスト接続を持っています!

+0

ありがとう、私は明日これを試してみよう! – KayZak

関連する問題