我把<appSettings>
<add key='SqlConnectionStr' value='Data Source=localhost;Initial Catalog=weboa;Integrated Security=True' />
</appSettings>放在了<configuration>后,运行失败提示一个配置文件只能有一个<configSections>元素,并且必须在根目录下的<configuration>的第一个元素,这是为什么??
<add key='SqlConnectionStr' value='Data Source=localhost;Initial Catalog=weboa;Integrated Security=True' />
</appSettings>放在了<configuration>后,运行失败提示一个配置文件只能有一个<configSections>元素,并且必须在根目录下的<configuration>的第一个元素,这是为什么??
一定是你config文件里面已经有了<appSettings>节点了
你将<add key='SqlConnectionStr' value='Data Source=localhost;Initial Catalog=weboa;Integrated Security=True' /> 这段添加到你现有的<appSettings> </appSettings>中间就可以了,<appSettings> </appSettings>不能同时有两个
修改成
<appSettings>
<add key='SqlConnectionStr' value='Data Source=localhost;Initial Catalog=weboa;Integrated Security=True'/>
</appSettings>