C#WinForm应用程序
问题描述:
我开发C#的小型应用程序中,我使用的是SQL Server数据库,但是当我运行我的应用程序我得到这个错误:C#WinForm应用程序
An unhandled exception of type 'System.Configuration.ConfigurationErrorsException' occurred in System.Configuration.dll
Additional information: Configuration system failed to initialize
谁能帮我解决这个错误?
The code of my save button shown in this image where exception error occurred和 我的app.config。文件是:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<connectionstring>
<add name="dbx" connectionstring="Data Source=JAWADKHAN-PC;Initial Catalog=jawad;Integrated Security=True" Providername="System.Data.SQLClient">
</add>
</connectionstring>
</configuration>
答
检查您的app.config文件。 在配置部分之后添加configSections。像 更换顺序:
<configuration>
<configSections>
....
</configsections>
.
.
如果这不能解决你的问题,然后张贴app.config文件进行审查。
请向我们展示您的'app.config'文件!显然**配置系统**有问题(因为异常消息明确指出) –
应用程序无法加载配置区段,因此在这里发布您的app.config肯定会有所帮助。 –
请用相关的保存代码[编辑]你的问题,而不是链接到图像。 –