0
這裏是我的流暢類映射:爲什麼我不能使用Fluent NHibernate將它插入到MySQL InnoDB表中?
class ImportedAccountsMap : ClassMap<ImportedAccounts>
{
public ImportedAccountsMap()
{
Id(x => x.Id);
Map(x => x.Acct_FName);
Map(x => x.Acct_LName);
Map(x => x.Acct_Phone1);
Map(x => x.Acct_Email);
Map(x => x.Date);
Map(x => x.Exists);
Map(x => x.Deleted);
}
}
我的控制器代碼
public void ImportInsertTest()
{
using (ISession session = MvcApplication.SessionFactory.OpenSession())
{
using (ITransaction tx = session.BeginTransaction())
{
ImportedAccounts ia = new ImportedAccounts();
ia.Date = "test";
ia.Deleted = false;
ia.Exists = false;
ia.Acct_FName = "test";
ia.Acct_LName = "test";
ia.Acct_Email = "[email protected]";
session.Save(ia);
tx.Commit();
}
}
}
我得到這個錯誤:
{"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 'Exists, Deleted) VALUES ('test', 'test', 'test', '[email protected]', 'test', 0, 0)' at line 1"}
我已經想通了,並打算提供一個答案,但我寧願給你信用的時間,你曾經回答。謝謝你,先生。 – Chazt3n