0

非常に陳腐な質問で申し訳ありませんが、いくつか具体的なことを理解する必要があります。

Visual Studio 2010 に SQL サーバー データベースを追加するたびに、App_Data の下にデータベースが作成され、サーバー エクスプローラーが使用する接続文字列は、ファイルを指す AttachDb フィールドを持つものになります。

2 つの IIS サーバー 6 と 7.5 でそれを試したところ、ユーザーが

"An attempt to attach an auto-named database for file XX failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share."

この形式「Server=\sqlexpress;Database=xxx;Trusted_Connection=True」を使用すると、

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.

あらゆる種類の接続文字列、構成、および組み合わせを 1 日かけて試しました!! =S

私の質問は次のとおりです。これを行う正しい方法は何ですか? SQL Management Studio 2008 R2 Express でデータベースを作成する必要がありますか? SQL SERVER 2008 R2 Express IIS Windows Server 2003 R2 では、どの種類の接続文字列が必要で、どのような構成が必要ですか?

4

1 に答える 1

0

統合されたセキュリティ (Windows 認証) 接続文字列を使用する必要があるようです。また、.\sqlexpress の代わりに localhost\sqlexpress を使用する必要がありました。IIS 7.5 の場合、アプリ プール ログインを SQL サーバー ログインに追加する必要があります。

于 2010-06-26T14:48:35.510 に答える