Hello.
I have been using Nhibernate together with MS Access, but I am now changing to MySql 5.0.
In my XML file I now have
Code:
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="dialect">NHibernate.Dialect.MySQL5Dialect</property>
<property name="connection.driver_class">NHibernate.Driver.MySqlDataDriver</property>
<property name="connection.connection_string">Server=localhost;Database=moon;User id=root;Password=pass;CharSet=latin1;</property>
I would like Nhibernate to create any nessesary tables. With the MS Access configuration I used
Code:
<property name="hibernate.hbm2ddl.auto">create</property>
But for some reason an error occurs when trying to build the session factory, the error:
Code:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Lines INTEGER, LineSamples INTEGER, HorPixScale DOUBLE, VerPixScale DOUBLE, PDSF' at line 1
If I leave out the hibernate.hbm2ddl.auto property the program starts, but when trying to fill in data I get an error like this:
Code:
could not insert: ...
No tables are created either.
The problem might be somthing with the dialect or charset, the DB is using latin1.
Does anyone now how to solve this?
Thanks!