私がコーディングしているとき、以下のコードは正常に機能しています。IISでコードを公開しましたが、接続に失敗します。
私がコーディングしているときは、ウィンドウログインをクレデンシャルとして取得し、IISではAppPoolIdentityを取得しています。Windowsのログイン資格情報をconnectionstringに渡すにはどうすればよいですか?
Public Shared Function DbCollection(connectionString As String) As DatabaseCollection
Dim server As New Microsoft.SqlServer.Management.Smo.Server(connectionString)
Return server.Databases
End Function
エラー:
Login failed for user 'Domain\Computername$'.
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\Computername$'.