Exception, Need the author of LLGLGEN

Posts   
 
    
quannv avatar
quannv
User
Posts: 11
Joined: 04-Jul-2005
# Posted on: 10-Oct-2005 05:41:12   

I've just modified llblgen code by hand, then I insert new record into database, the error is following. An exception was caught during the execution of an action query: Object must implement IConvertible.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception. I've traced logs, The insert query lack of parameter, althought Values keyword is working fie. Log is below:


lack of ChangeProperties,IsOwner properties of Insert keyword.

[queryExecuted  "\r\n\tQuery: INSERT INTO [PM].[dbo].[CategoryRules] ([DocCatRuleID],[CategoryID],[NewCategory],[DelCategory],[DocCheckOuts], [DocCheckIns],[NewDocument],[FileTypeRestrict],[ItemID]) VALUES (@DocCatRuleId,@CategoryId,@DocCheckOuts,@DocCheckIns,@DelDocument, @NewDocument,@ItemId,@ChangeProperties,@IsOwner)

Code should be:


[b][NewDocument],[FileTypeRestrict],[ItemID],[ChangeProperties], [IsOwner] ) VALUES [/b]

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 10-Oct-2005 08:40:45   

You modified the code, what did you modify? Without that knowledge I think it's impossible to understand why you get an error. Also the code which inserts the entity is important.

Frans Bouma | Lead developer LLBLGen Pro
quannv avatar
quannv
User
Posts: 11
Joined: 04-Jul-2005
# Posted on: 10-Oct-2005 08:55:48   

Otis wrote:

You modified the code, what did you modify? Without that knowledge I think it's impossible to understand why you get an error. Also the code which inserts the entity is important.

I added 2 properties to entity by hand, then I do some steps to compile successfully code. I do also like that with other entities,code is working fine. But this one is not working fine

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 10-Oct-2005 10:24:16   

quannv wrote:

Otis wrote:

You modified the code, what did you modify? Without that knowledge I think it's impossible to understand why you get an error. Also the code which inserts the entity is important.

I added 2 properties to entity by hand, then I do some steps to compile successfully code. I do also like that with other entities,code is working fine. But this one is not working fine

Could you paste that code and also hte code you use to insert the entity please. ?

Frans Bouma | Lead developer LLBLGen Pro
quannv avatar
quannv
User
Posts: 11
Joined: 04-Jul-2005
# Posted on: 10-Oct-2005 11:20:06   

Otis wrote:

quannv wrote:

I added 2 properties to entity by hand, then I do some steps to compile successfully code. I do also like that with other entities,code is working fine. But this one is not working fine

Could you paste that code and also hte code you use to insert the entity please. ?

I have a table 'CategoryRules' in my database, first time, I generated by LLBLGen and it's fine (in compiling and running), then, I added two fileds into this table, 'IsOwner' & 'ChangeProperties' on MSSQL Server 2000, So I generated code by hand in the folowing way: I add methods and properties acording to 2 new fields to the files CategoryRulesEntity.cs, ConstantEnum.cs, PersistenceInfoFactory.cs. I compiled project and it's fine, but when I ran, the error orcurred:

try { adapter.SaveEntity(m_crEntity);// save my CategoryRulesEntity } catch(ORMQueryExecutionException ormEx) { throw new FacadeException(ormEx.Message); }

I've checked in database, I found that a new record made but 2 new fields is NULL.

quannv avatar
quannv
User
Posts: 11
Joined: 04-Jul-2005
# Posted on: 10-Oct-2005 11:39:15   

I found what caused that error: That's order of methods 'toReturn.AddFieldPersistenceInfo' in PersistenceInfoFactory.cs file, it must be coresponding to the order of fileds in the table. Now it's OK. Thanks for your regards!