如何在C#中使用Spatialite?

时间:2018-10-11 09:00:58

标签: c# sqlite spatialite

我试图从sqlite数据库中选择几何字段。
尝试过本指南https://gist.github.com/lydonchandra/5023e1076c338748b5c8

    static bool is64bitProcess()
    {
        return (IntPtr.Size == 8);
    }

    static bool is32bitProcess()
    {
        return (IntPtr.Size == 4);
    }

 internal void SqliteTest()
    {
        string mod_spatialite_folderPath = "mod_spatialite-4.3.0a-win-amd64";

        if (is64bitProcess())
        {
            Console.WriteLine("64bit process");
            mod_spatialite_folderPath = "mod_spatialite-4.3.0a-win-amd64";
        }
        else if (is32bitProcess())
        {
            Console.WriteLine("32bit process");
            mod_spatialite_folderPath = "mod_spatialite-4.3.0a-win-x86";
        }

        using (var conn = new SQLiteConnection(ConnectionString))
        {
            conn.Open();
            conn.LoadExtension($@"{mod_spatialite_folderPath}\mod_spatialite");

            conn.Close();
        }
   }

但是在线:

conn.LoadExtension($@"{mod_spatialite_folderPath}\mod_spatialite");

我收到can't find libfreexl-1.dll

的错误消息

我看到该dll存在于mod_spatialite.dll文件夹中。
我想念什么?

0 个答案:

没有答案