Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6822915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:43:13+00:00 2026-05-26T21:43:13+00:00

I am planning to do a project using Mono and SQLite as the database.

  • 0

I am planning to do a project using Mono and SQLite as the database. Development is to be done primarily on a Mac. I have successfully setup Mono and tested System.Data.SQLite(managed dll). Simple test applications work perfectly.

However when I tried to use DataTable in my code it throws a runtime exception. Following is the code snippet:

public static void Main (string[] args)
{
    string connectionString = "Data Source=emp.db";

    try {
        using (SQLiteConnection conn = new SQLiteConnection(connectionString))
        {
            string query = "SELECT firstname, lastname FROM employees";

            using (SQLiteCommand comm = new SQLiteCommand(query, conn))
            {
                conn.Open();

                comm.CommandText = query;

                using (SQLiteDataReader reader = comm.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        string firstname = reader.GetString(0);
                        string lastname  = reader.GetString(1);
                        Console.WriteLine("Name: " + firstname + " " + lastname);
                    }

                    DataTable dt = new DataTable();
                    dt.Load(reader);  // line 39 where problem occurs
                }
            }
        }
    } catch (Exception e) {
        Console.WriteLine(e);
    }
}

The above code get built successfully but does not run on my development machine and gives the following output on the terminal.

The output when I run the application is as below:

Name: John Doe
Name: Eric Smith
System.EntryPointNotFoundException: sqlite3_column_origin_name
  at (wrapper managed-to-native) System.Data.SQLite.UnsafeNativeMethods:sqlite3_column_origin_name (intptr,int)
  at System.Data.SQLite.SQLite3.ColumnOriginalName (System.Data.SQLite.SQLiteStatement stmt, Int32 index) [0x00000] in <filename unknown>:0 
  at System.Data.SQLite.SQLiteDataReader.GetSchemaTable (Boolean wantUniqueInfo, Boolean wantDefaultValue) [0x00000] in <filename unknown>:0 
  at System.Data.SQLite.SQLiteDataReader.GetSchemaTable () [0x00000] in <filename unknown>:0 
  at System.Data.Common.DataAdapter.BuildSchema (IDataReader reader, System.Data.DataTable table, SchemaType schemaType, MissingSchemaAction missingSchAction, MissingMappingAction missingMapAction, System.Data.Common.DataTableMappingCollection dtMapping) [0x0003b] in /private/tmp/monobuild/build/BUILD/mono-2.10.6/mcs/class/System.Data/System.Data.Common/DataAdapter.cs:284 
  at System.Data.DataTable.Load (IDataReader reader, LoadOption loadOption) [0x0001f] in /private/tmp/monobuild/build/BUILD/mono-2.10.6/mcs/class/System.Data/System.Data/DataTable.cs:2853 
  at System.Data.DataTable.Load (IDataReader reader) [0x00011] in /private/tmp/monobuild/build/BUILD/mono-2.10.6/mcs/class/System.Data/System.Data/DataTable.cs:2838 
  at SQLiteApp.MainClass.Main (System.String[] args) [0x00086] in /Users/nayaabkhan/Projects/SQLiteApp/SQLiteApp/Main.cs:37

I was surprised to see that the same above executable worked perfectly under windows, but was failing on my development machine.

Searching on the internet, I found that this problem has to do something with the sqlite dynamic library and must be compiled with SQLITE_ENABLE_COLUMN_METADATA. I’ve tried to compile sqlite with the SQLITE_ENABLE_COLUMN_METADATA as well. I don’t know where to put the compiled libsqlite3.0.dylib.

Any help will be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:43:14+00:00Added an answer on May 26, 2026 at 9:43 pm

    You need to put the dylib anywhere mono can find it.

    You can find out where mono looks for native libraries by doing this:

    export MONO_LOG_LEVEL=debug
    export MONO_LOG_MASK=dll
    mono yourprogram.exe
    

    and verbose lookup output will be printed to the terminal. On my system mono looks first in the directory where the executable is, so putting the dylib there is probably the easiest. Then mono asks the system to find the dylib (by trying to open it without a path). The system typically looks in /usr/lib and maybe a few other places (this is of course system-dependent), but in any case you can add a path for the system to look in by setting LD_LIBRARY_PATH to that path. In this case you’ll do this:

    export LD_LIBRARY_PATH=/path/to/dylib:$LD_LIBRARY_PATH
    mono yourprogram.exe
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following situation. I have 3 tables in a resource planning project(created using
I'm currently planning a new web project. Clients are going to connect using a
I have a rather large (freeware) project written with Delphi 2007 which is using
I have a WPF project and I have added support for localization using Satellite
hey friends, i have been assigned a query planning project. in this project if
I'm working with a little project that I'm planning on using HTML5 in. So
I'm using an existing database for my latest Django project, so unless I change
I am planning on using Riak for a project I am working on and
I am planning on using PyCrypto for a project and I want to know
I have a new project starting up, and I was planning to use git

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.