Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/287.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MissingMethodException C#Sqlite Compact框架_C#_.net_Sqlite_Windows Mobile_Compact Framework - Fatal编程技术网

MissingMethodException C#Sqlite Compact框架

MissingMethodException C#Sqlite Compact框架,c#,.net,sqlite,windows-mobile,compact-framework,C#,.net,Sqlite,Windows Mobile,Compact Framework,我正在开发一个应用程序,使用sqlite作为我的windows ce mobile上的数据库。当我尝试打开连接时,我得到一个异常作为MissingMethodException。 我已经添加了sqlite和interop dll,但我仍然收到了消息 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using S

我正在开发一个应用程序,使用sqlite作为我的windows ce mobile上的数据库。当我尝试打开连接时,我得到一个异常作为MissingMethodException。 我已经添加了sqlite和interop dll,但我仍然收到了消息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SQLite;

namespace AGDeviceSample
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try {


                SQLiteConnection conn = new SQLiteConnection("Data Source=agm.sqlite;Version=3;");

                conn.Open();

            }catch(Exception e2){

                MessageBox.Show(" " + e2.Message);
            }

        }
    }
}

您可以使用
MessageBox.Show(e2.ToString())
以获取有关异常的详细信息。您的设备是否有Compact Framework 2.0或3.5?我的是DeviceApplicationTest1.Form1.button1\u Click()\r\n在System.Windows.Forms.Control.OnClick()\r\n在System.Windows.Forms.Button.OnClick()\r\n在System.Windows.Forms.ButtonBase.WnProc()\r\n在System.Windows.Forms.Control\r\n在Microsoft.AGL.Forms.EVL.EnterMainLoop()\r\n在System.Windows.Forms.Application.Run()\r\n在DeviceApplicationTest1.Program.Main()\r\n“该版本的SQLite似乎需要.NET CF 3.5。看,是的。这就是问题所在。。谢谢:)