【发布时间】:2017-06-29 20:41:17
【问题描述】:
我正在尝试在作为 Xamarin Forms 应用程序一部分的 UWP 项目中使用 SqlConnection 类。我需要对我添加的 System.Data.DLL 的引用。但是,当我尝试像这样创建 SqlConnection 时:
using (SqlConnection connection = new SqlConnection(queryString))
{
};
我收到错误 Reference to type 'Component' claims it is defined in 'System', but it could not be found.
我可以像这样声明一个 SqlConnection 变量:
SqlConnection con = new SqlConnection();
我只有在尝试使用该对象时才会收到错误消息。比如在using 语句中。
我不确定我做错了什么。网站上的其他类似问题似乎对我的情况没有帮助。
【问题讨论】:
标签: c# xamarin uwp xamarin.forms