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 5965713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:40:29+00:00 2026-05-22T19:40:29+00:00

I wrote a simple app in mono (C#) that uses NHibernate with MYSQL –

  • 0

I wrote a simple app in mono (C#) that uses NHibernate with MYSQL – and I now want to port it to SQLite.

My hope is (was) that I could simply change hibernate.cfg.xml and point it to a different database. Here is my modified hibernate.cfg.xml:

    <?xml version="1.0" encoding="utf-8" ?>

    <hibernate-configuration  xmlns="urn:nhibernate-configuration-2.2" >
        <session-factory name="NHibernate.Test">
            <property name="connection.driver_class">NHibernate.Driver.SQLite20Driver</property>
            <property name="connection.connection_string">
                Data Source=nhibernate_test.db;Version=3
            </property>
            <property name="dialect">NHibernate.Dialect.SQLiteDialect</property>
            <property name="query.substitutions">true=1;false=0</property>
            <property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property>
        </session-factory>

</hibernate-configuration> 

The problem is that I’m getting an error to the effect that it can’t find System.Data.SQLite. This doesn’t surprise me since, as I understand it, in mono we should be using Mono.Data.SQLite.

The trouble is (assuming I’m understanding the problem correctly) I don’t know how to tell NHibernate to use Mono.Data.SQLite instead of System.Data.SQLite.

This is all being done on Linux – if that makes any difference.

Does anyone have any ideas how to proceed?

  • 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-22T19:40:30+00:00Added an answer on May 22, 2026 at 7:40 pm

    You need to make nHibernate aware of the Mono.Data.SQLite assembly. Add this to the configuration:

    <add key="connection.driver_class" value="Name.Space.MonoSqliteDriver, AssemblyName" />
    

    And you also need a simple MonoSQLiteDriver class:

    public class MonoSqliteDriver : NHibernate.Driver.ReflectionBasedDriver  
    {  
        public MonoSqliteDriver() :   
            base("Mono.Data.Sqlite",  
            "Mono.Data.Sqlite.SqliteConnection",  
            "Mono.Data.Sqlite.SqliteCommand")  
        {  
        }  
        public override bool UseNamedPrefixInParameter {  
            get {  
                return true;  
            }  
        }  
        public override bool UseNamedPrefixInSql {  
            get {  
                return true;  
            }  
        }  
        public override string NamedPrefix {  
            get {  
                return "@";  
            }  
        }  
        public override bool SupportsMultipleOpenReaders {  
            get {  
                return false;  
            }  
        }  
    }  
    

    (code taken from http://intellect.dk/post/Why-I-love-frameworks-with-lots-of-extension-points.aspx )

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote a simple Sinatra app that generate an image using rmagick from some
I wrote a simple webapp using google app engine in python that allows users
I have a simple Google App Engine app, that I wrote using ordinary strings.
So I wrote this simple console app to aid in my question asking. What
I am trying to learn Android app development and wrote a very simple app
I would to write a simple NodeJS app, that reads a file, analyzes its
I'm writing a simple web app in PHP that needs to have write access
I wrote a simple web app to let user input data as they walk
I wrote not so simple app, and decided to make applet. I have the
I am currently trying to write a very simple app that sends an object

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.