【发布时间】:2017-09-03 21:23:39
【问题描述】:
我用 C# 开发了一个使用 SQL Server 数据库的小型应用程序,但是当我运行我的应用程序时出现以下错误:
System.Configuration.dll 中出现“System.Configuration.ConfigurationErrorsException”类型的未处理异常
附加信息:配置系统初始化失败
谁能帮我解决这个错误?
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文件! 配置系统显然有问题(正如异常消息明确指出的那样) -
应用程序无法加载配置部分,在这里发布您的 app.config 肯定会有所帮助。
-
请Edit您的问题使用相关的保存代码而不是图像链接。
标签: c# .net sql-server winforms