Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't get Firebird Embedded work with FluentNHibernate
    primarykey
    data
    text
    <p>Newbie here,</p> <p>This is the first time I use Firebird. I want to use Firebird Embedded with FluentNHibernate, but it throws exception when I tried to run my test program. The test project can be downloaded from <a href="http://dl.dropbox.com/u/1421509/forums/stackoverflow.com/TestFirebird.zip" rel="nofollow">here</a>.</p> <p>My system configurations:</p> <ul> <li>Firebird-2.5.0.26074-0_Win32_embed</li> <li>Firebird ADO.NET Data Provider 2.6.5</li> <li>FluentNHibernate 1.2.0.712</li> <li>NHibernate 3.1.0.4000</li> <li>Visual Studio 2010 SP1</li> <li>.NET Framework 4.0</li> <li>Windows 7 64bit</li> </ul> <p>Below is the steps I took:</p> <ol> <li>Download <code>Firebird-2.5.0.26074-0_Win32_embed.zip</code> from <a href="http://www.firebirdsql.org/en/firebird-2-5/" rel="nofollow">here</a>.</li> <li>Download <code>NETProvider-2.6.5.zip</code> from <a href="http://www.firebirdsql.org/en/net-provider/" rel="nofollow">here</a>.</li> <li>Create a new Console application in Visual Studio 2010.</li> <li>Extract the contents of the zip files to <code>.\bin\Debug</code></li> <li>Write test code (see details below).</li> <li>Press F5.</li> </ol> <p>But I got the following exception at <code>new SchemaExport(cfg).Create(false, true);</code>:</p> <p><code>FbException was unhandled by user code: Dynamic SQL Error SQL error code = -607 Invalid command Table A does not exist</code></p> <p>After further tests, I found if I remove the <code>FirebirdSql.Data.FirebirdClient.pdb</code> file of <code>NETProvider-2.6.5.zip</code> from <code>.\bin\Debug</code> folder. The test program could run without error. But I'm not sure if removing it would cause other problems.</p> <p>Below is my test code:</p> <pre><code>class Program { static void Main(string[] args) { ISessionFactory sessionFactory = BuildSessionFactory(); using (ISession session = sessionFactory.OpenSession()) { using (ITransaction trans = session.BeginTransaction()) { } } } static ISessionFactory BuildSessionFactory() { string dbPath = "test.db"; string connectionString = String.Format( "User=SYSDBA;Password=masterkey;Database={0};Dialect=3;Charset=UTF8;ServerType=1;", dbPath); if (File.Exists(dbPath)) File.Delete(dbPath); FbConnection.CreateDatabase(connectionString); FirebirdConfiguration cfg = new FirebirdConfiguration() .ConnectionString(connectionString) .AdoNetBatchSize(100); ISessionFactory sessionFactory = Fluently.Configure() .Database(cfg) .Mappings(m =&gt; m.FluentMappings.Add(typeof(AMappings))) .ExposeConfiguration(BuildSchema) .BuildConfiguration() .BuildSessionFactory(); return sessionFactory; } static void BuildSchema(Configuration cfg) { new SchemaExport(cfg).Create(false, true); } public class AMappings : ClassMap&lt;A&gt; { public AMappings() { Id(x =&gt; x.Id).GeneratedBy.HiLo("100"); Map(x =&gt; x.Text); } } public class A { public virtual long Id { get; private set; } public virtual string Text { get; set; } } } </code></pre> <p>Any ideas? Thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload