[英]c# System.MissingMethodException in sqlite3
I'm making ac# application which uses sqlite3 database. 我正在制作使用sqlite3数据库的ac#应用程序。 For sqlite, I'm using System.Data.SQLite.dll .
对于sqlite,我正在使用System.Data.SQLite.dll 。 The problem is on some systems the program works fine, but on others, it throws
System.MissingMethodException
while reading the database. 问题是在某些系统上程序可以正常运行,但在其他系统上,读取数据库时会引发
System.MissingMethodException
。
This is the code I'm using for reading : 这是我用来阅读的代码:
using (System.Data.SQLite.SQLiteConnection con = new System.Data.SQLite.SQLiteConnection("data source=" + file_name))
{
using (System.Data.SQLite.SQLiteCommand com = new System.Data.SQLite.SQLiteCommand(con))
{
con.Open();
com.CommandText = "Select * FROM my_table;";
using (System.Data.SQLite.SQLiteDataReader reader = com.ExecuteReader())
{
while (reader.Read())
{
Console.WriteLine(reader["field1"] + " : " + reader["field2"] +" : " + reader["field3"]);
if(reader["field1"].ToString().Equals("1"))
{
xlWorkSheetR1.Cells[i, 2] = reader["field1"];
xlWorkSheetR1.Cells[i, 3] = reader["field2"];
i++;
}
}
}
con.Close();
}
}
And this is the error I'm getting : 这是我得到的错误:
Can you please tell me what is causing this exception ? 您能告诉我是什么导致此异常吗? And how to avoid it ?
以及如何避免呢?
Check if 检查是否
Version of System.Data.SQLite.dll is same across all machines 所有计算机上的System.Data.SQLite.dll版本相同
Version of .NET frameworks installed on these machines 这些计算机上安装的.NET Framework版本
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.