This article is a mirror article of machine translation, please click here to jump to the original article.

View: 24423|Reply: 1

[Source] The NHibernate column "ReservedWord" does not belong to the table ReservedWords

[Copy link]
Posted on 3/27/2018 3:07:27 PM | | |

NHibernate+FluentNHibernate+MySql

The yellow pages show the following exceptions during runtime, and the keywords in this column have not appeared in the project for a long time.

[ArgumentException: The column "ReservedWord" does not belong to the table ReservedWords.] ]
   System.Data.DataRow.GetDataColumn(String columnName) +5310119
   System.Data.DataRow.get_Item(String columnName) +13
   NHibernate.Dialect.Schema.AbstractDataBaseSchema.GetReservedWords() +170
   NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.GetReservedWords(Dialect dialect, IConnectionHelper connectionHelper) +100
   NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.Update(ISessionFactory sessionFactory) +78
   NHibernate.Impl.SessionFactoryImpl.. ctor(Configuration cfg, IMapping mapping, Settings settings, EventListeners listeners) +700
   NHibernate.Cfg.Configuration.BuildSessionFactory() +104
   FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in c:\work\coding\fluentNhibernate\src\FluentNHibernate\Cfg\FluentConfiguration.cs:230

[FluentConfigurationException: An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.]

  

Baidu to a similar question below:

error1.  Could not create the driver from NHibernate.Driver.MySqlDataDriver

Solution: When using Nhibernate to connect to Mysql, please manually copy the MySql.Data.dll file to xxx/project file directory/bin/Debug to solve this problem!

error2. The column "ReservedWord" does not belong to the table ReservedWords
Workaround:Add <property name="hbm2ddl.keywords" >none to the hibernate.cfg.xml configuration file</property>


Finally, find the corresponding method configured with FluentNHibernate on stackoverflow (configuration in the last line):






Previous:Winform ink handwriting recognition source code
Next:The Stretch property of the Image in WPF
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com