Hi
I have been having a hell of a time trying to get some LLBLGen code working. Firstly I had a problem where it was generating duplicate functions (with identical signatures) in the same classes, but I fixed this by rebuilding the database from scratch and it worked - strange?
Now I am unable to save a new entity to an empty table. I am using Microsoft Access and the table (called tblMessage) I am INSERTING into is:
MsgID, AutoNumber (Long Integer), Primary Key
MsgDateTime, Date/Time, Reqd
MsgTo, Text
MsgFrom, Text
MsgSubject, Text
MsgText, Memo
This is the function I have for saving the data to the DL:
Dim message As MessageEntity = New MessageEntity
message.MsgTo = "All"
message.MsgDateTime = DateTime.Now
message.MsgText = "Some message"
Return message.Save()
When I set a breakpoint in the AddMessage function of the MessageDAO class an exception is thrown when the Base.ExecuteActionQuery is reached. I have checked the query being executed and this is also below.
Public Function AddMessage(fields As IEntityFields, containingTransaction As ITransaction) As Boolean
If fields Is Nothing Then
Throw New ArgumentNullException("fields", "fields can't be null")
End If
Dim insertQuery As IActionQuery = DynamicQueryEngine.CreateInsertDQ(fields, DbUtils.DetermineConnectionToUse(containingTransaction))
Dim wasSuccesful As Boolean = (MyBase.ExecuteActionQuery(insertQuery, containingTransaction) > 0)
If wasSuccesful Then
insertQuery.ReflectOutputValuesInRelatedFields()
End If
Return wasSuccesful
End Function
"INSERT INTO [tblMessage] ([MsgDateTime],[MsgTo],[MsgText]) VALUES (@MsgDateTime,@MsgTo,@MsgText)"
The error message displayed back to the browser window is:
An exception was caught during the execution of an action query: Operation must use an updateable query.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.
PLEASE HELP!!