TDL

Posts   
 
    
JimFoye avatar
JimFoye
User
Posts: 656
Joined: 22-Jun-2004
# Posted on: 02-Feb-2006 03:59:00   

What is the difference between these?


<[ EntityFieldName ]>
<[ SourceColumnName ]>

Also, why do some things not show up in Intellisense? For example...


Not 
IsSubType

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 02-Feb-2006 05:00:58   

In the designer you can change the name of your field to be different from what the source column was. Also if you change the name of a column in the database it won't change in llblgen when you regenerate, so then they would be different then too. Not sure about the intellisense though.

JimFoye avatar
JimFoye
User
Posts: 656
Joined: 22-Jun-2004
# Posted on: 02-Feb-2006 06:51:47   

bclubb wrote:

In the designer you can change the name of your field to be different from what the source column was.

Ah right, thanks!

I have a TDL snippet that will generate a GetFieldLength() method for each entity. I would be happy to post it here if anyone is interested, or even post in the user section. If I'm going to do that, I would probably want to make put it in a separate file with an example of how to treat it as an include template. Also, it takes a field name, not index; there's an important reason for this, as this is part of a larger validation effort I'm doing, and it has to be called from a higher layer piece of code that is generic and doesn't know what entity it is calling to get the max length for a field. But I could make a version that takes a field index instead.

I know Frans would kick this out in 2 minutes, but I'm all happy with myself for doing it at all.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39786
Joined: 17-Aug-2003
# Posted on: 02-Feb-2006 09:35:29   

entity.Fields[index].MaxLength is the length of a field if it's a stringtype. It's already in the code simple_smile

Frans Bouma | Lead developer LLBLGen Pro
JimFoye avatar
JimFoye
User
Posts: 656
Joined: 22-Jun-2004
# Posted on: 02-Feb-2006 17:27:21   

When did you put that in??flushed

[Edit] http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=4117&HighLight=1

[Edit] Sorry, starting to lose my mind. Seriously...too many late nights.

Ok, yes, but that requires an entity instance. Originally I wanted something that didn't. Now the way I am doing things, I actually have an entity instance. But, the piece of code that sets edit controls' max length doesn't know about the field indexes, it just has a field name.

So, this template snippet is very useful if you have a field name and not index. And, it could be made static so as to not require an entity instance. Sorry for any confusion.

Last week I thought it was Jan 23 when actually it was the 30th. My wife is starting to get worried my mind is going. But it's just the 12 hour days.

simple_smile