Fetch issue on VB codesmith templates

Fetch issue on VB codesmith templates

Old forum URL: forums.lhotka.net/forums/t/2241.aspx


gloehr posted on Tuesday, January 30, 2007

I'm trying to use Codesmith with the VB CSLA templates for the first time.  I have a few basic questions and one particular issue at the moment.  I'm trying to generate an editable root object class, along with a corresponding read-only root list class.  When I bring the code for both into visual studio, I have an error in the ExecuteFetch method on the list class.  The error is as follows:

Value of type 'Csla.Data.SafeDataReader' cannot be converted to 'Integer'. 

Here's the line of code where the error occurs:  
Me.Add(Person.GetPerson(dr))

So I'm sure I'm missing something simple.  In the Person root object class, there is no factory method that accepts "dr" as an argument.  I could pass in dr.getint32("personID") but that would result in a multiple separate transactions.

Aside from my specific question above, I'm also wondering if anybody can shed some light on how they use the templates.  I've been testing different approaches.  If anybody can recommend some best practices on usage that would be great.  Particularly, I'm wondering what is the best order to do things?  I've created the tables in SQL.  I've generated basic CRUD stored procedures using the built in codesmith templates.  When I'm creating the CSLA classes, I'm specifying the stored procedures in the command object property.  Does that sound like typical usage?

Thanks
Greg

 

Copyright (c) Marimer LLC