2012-05-13 3 views
-1

私はasp.netプロジェクトを開発しました。 Visual Studio 2010のtempraryサーバーでVisual Studio 2010を接続していますが、iisに接続すると接続しません。この問題をどうやって解決できますか? 私のweb.configはそうです。ASP.NETプロジェクトをIISに配置する方法

<?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> 
<system.web> 
    <compilation debug="true" targetFramework="4.0"> 
     <assemblies> 
      <add assembly="System.Design, Version=4.0.0.0,  Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 
      <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
      <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation> 
</system.web> 

<connectionStrings> 
<add name="ConnectionString" 
connectionString="Server=SRV-WORKFLOW; Database=PTC;User ID = MIKES\EMREAL;Password=EMAL5616.;Trusted_Connection=True;" 
    providerName="System.Data.SqlClient" /> 

<add name ="PTCconnection" 
    connectionString="Server=SRV-PLM; Database=wcadmin;User ID = MIKES\EMREAL;Password=EMAL5616.;Trusted_Connection=True;" 
    providerName="System.Data.SqlClient" /> 




</connectionStrings> 



</configuration> 
+0

詳細を入力してください。あなたのアプリケーションはまったく表示されないのですか、またはIISで動作しているときにdbに接続できませんか?エラーメッセージや例外が出ますか? – Jason

+0

iisでアプリケーションを実行するとデータベースに接続できません – EmreAltun

答えて

3

あなたは、それはアプリが下で実行され、ユーザーからの資格情報を使用してデータベースに接続しようとする意味Trusted_Connection=Trueを使用しています。 IISの場合、通常はAppPoolユーザーです。このユーザーにデータベースへのアクセスを許可するか、アプリケーションプールユーザーを変更するか、SQL Server認証を使用します。

ここで接続文字列の概要を得ることができます:http://connectionstrings.com/

+0

AppPoolユーザーを変更するにはどうすればよいですか? Windows認証を使用する必要があります – EmreAltun

+0

IIS 7の場合はhttp://technet.microsoft.com/en-us/library/cc771170(v=ws.10).aspx、http://www.microsoft.com/technet/ IIS 6の場合、prodtechnol/WindowsServer2003/Library/IIS/f05a7c2b-36b0-4b6e-ac7c-662700081f25.mspx?mfr = true – Sascha

関連する問題