我编写了一个简单的 wpf 应用程序,用于在 datagrid 中绑定数据。在下一行运行时会引发错误。
string ConString = System.Configuration.ConfigurationManager
.ConnectionStrings["ConString"].ToString();
异常显示:Exception has been thrown by the target of an invocation."
InnerException:{"Object reference not set to an instance of an object."}