Я использую Nhibernate 4 и FluentNhibernate 2.0.3 с БД Microsoft Access 2000. Я не могу сохранить запись в БД, потому что я получаю сообщение об ошибке при вводе Примечание поле отправки запроса HTTP POST, например:
{"Примечание": "bla bla bla"}
ПРИМЕЧАНИЕ: В таблице базы данных столбец "Примечание"устанавливается как «ДОЛГО ТЕКСТ» (не требуется)
Может ли быть проблема преобразования типов данных?
Вот трассировка стека:
NHibernate.Exceptions.GenericADOException: could not insert: [Domain.Destinatari#1773][SQL: INSERT INTO `Destinatari` (Note, IDDestinatario) VALUES (?, ?)] ---> System.Data.OleDb.OleDbException: Errore di sintassi nell'istruzione INSERT INTO.
in System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr)
in System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
in System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
in System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
in System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
in System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
in NHibernate.JetDriver.JetDbCommand.ExecuteNonQuery()
in NHibernate.AdoNet.AbstractBatcher.ExecuteNonQuery(IDbCommand cmd)
in NHibernate.AdoNet.NonBatchingBatcher.AddToBatch(IExpectation expectation)
in NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object id, Object[] fields, Boolean[] notNull, Int32 j, SqlCommandInfo sql, Object obj, ISessionImplementor session)
--- Fine della traccia dello stack dell'eccezione interna ---
in NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object id, Object[] fields, Boolean[] notNull, Int32 j, SqlCommandInfo sql, Object obj, ISessionImplementor session)
in NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object id, Object[] fields, Object obj, ISessionImplementor session)
in NHibernate.Action.EntityInsertAction.Execute()
in NHibernate.Engine.ActionQueue.Execute(IExecutable executable)
in NHibernate.Engine.ActionQueue.ExecuteActions(IList list)
in NHibernate.Engine.ActionQueue.ExecuteActions()
in NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource session)
Ниже моегокод сопоставления:
Public Class DestinatariMap
Inherits ClassMap(Of Destinatari)
Public Sub New()
MyBase.New
LazyLoad()
Id(Function(x) x.IDDestinatario).GeneratedBy().Increment()
Map(Function(x) x.Note)
End Sub
End Class
Вот мой код домена:
Public Class Destinatari
Private _ID_Destinatario As Integer
Private _Note As String
Public Overridable Property IDDestinatario() As Integer
Get
Return Me._ID_Destinatario
End Get
Set
Me._ID_Destinatario = Value
End Set
End Property
Public Overridable Property Note() As String
Get
Return Me._Note
End Get
Set
Me._Note = Value
End Set
End Property
End Class
Спасибо