[英]Error CS0012: The type 'DbConnection' is defined in an assembly that is not referenced
I got this error 我收到了这个错误
Error CS0012: The type 'DbConnection' is defined in an assembly that is not referenced. 错误CS0012:类型“DbConnection”在未引用的程序集中定义。 You must add a reference to assembly 'System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. 您必须添加对程序集'System.Data,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'的引用。 (CS0012) (CS0012)
I'm trying to do this: 我正在尝试这样做:
private void SetConnection()
{
sql_con = new SQLiteConnection("DataSource=kyriosDB.db;Version=3;New=False;Compress=True;");
}
public void ExecuteQuery(string txtQuery)
{
SetConnection();
sql_con.Open();
sql_cmd = sql_con.CreateCommand();
sql_cmd.CommandText = txtQuery;
sql_cmd.ExecuteNonQuery();
sql_con.Close();
}
Someone can help me? 有人可以帮帮我吗?
我通过去项目解决了它 - 添加引用然后我在Mac上手动添加System.Data ...我不知道VS windows但是希望它是一样的
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.