【发布时间】:2015-01-06 11:45:07
【问题描述】:
我正在尝试将我的网页 (c#) 移动到 ISS 7.5 服务器。
我已经读到我需要把 WEBCONFIG 来实现与 sql server 2008 的连接。
我已经这样做了。
这是我的 WEBCONFIG
<?xml version="1.0" encoding="UTF-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<connectionstrings>
<!-- <remove name="LocalSqlServer" /> -->
<add name="conexionsql" connectionstring="Data Source=FCH-DESARROLLO;Initial Catalog=DesaInterno;Integrated Security=True;User ID=usuario_de_conexion;Password=a"
providerName="System.Data.SqlClient"/>
</connectionstrings>
<system.web>
<!--<identity impersonate="true" /> -->
<compilation debug="true" targetFramework="4.5">
<assemblies>
<!-- <add assembly="System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> -->
<add assembly="*" />
</assemblies>
</compilation>
<!-- <httpRuntime targetFramework="4.5"/> -->
<!-- <authentication mode="Windows" /> -->
<authorization>
<deny users="?" />
</authorization>
</system.web>
<!-- <system.webServer> -->
<!-- <defaultDocument>
<files>
<add value="index.aspx" />
</files>
</defaultDocument> -->
<!--</system.webServer> -->
<!-- <connectionStrings>
<remove name="LocalSqlServer" />
<add connectionString="Server=10.10.201.79;Database=DesaInterno;Integrated Security=true" name="LocalSqlServer" />
</connectionStrings> -->
</configuration>
当我尝试在 IIS 中运行我的应用程序时出现错误。
错误 HTTP 500.19 - 内部服务器错误 配置部分 'connectionStrings' 无法读取,因为它缺少一个部分 声明
【问题讨论】:
标签: c# c#-4.0 database-connection connection-string