Change length for generated field manually

Posts   
 
    
Stephan
User
Posts: 63
Joined: 16-Jan-2007
# Posted on: 10-Nov-2008 13:01:07   

Hi, at the moment I want to change the type of one of the properies of an entity. The current value is VarChar(200) and this should be changed to VarChar(max).

The problem I encountered is that the generated code is not in sync with the DB design flushed . I tried to generate the code again but there are too much errors in my BL. So for the time being and for the sake of time, I want the change the generated code just for this field. I found I could change it in the code (I think it is somewhere in the helperclasses, but I don't have the code here right now, I found just one place where I had to change it), I changed it to the appropriate value. I can compile, I can start the application but when saving only the first 200 chars are saved.

So can someone tell me what and where to change the generated code for this new value (Which source-code files)?

I know I should be more careful in changing db design en generate code. But I'm a little short of time right now to correct this. confused

Hope someone can help.

TIA

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 10-Nov-2008 17:16:37   

It should be in the PersistenceInfoProvider.cs

Look for a method called Init-EntityName-Mappings. (replace -EntityName- with your entityname).

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 11-Nov-2008 11:39:33   

Still, I advice you strongly to fix the BL errors after a new code generation so the DB IS in sync with the generated code. The reason is maintainability. You now fix this one issue by modifying a single line, and perhaps move on to another project. The code is then later on maintained by another person / team and they run into all kinds of weird errors which they can't fix at first.

Frans Bouma | Lead developer LLBLGen Pro
Stephan
User
Posts: 63
Joined: 16-Jan-2007
# Posted on: 12-Nov-2008 11:34:52   

Otis wrote:

Still, I advice you strongly to fix the BL errors after a new code generation so the DB IS in sync with the generated code. The reason is maintainability. You now fix this one issue by modifying a single line, and perhaps move on to another project. The code is then later on maintained by another person / team and they run into all kinds of weird errors which they can't fix at first.

Absolutely right. I will do that. But we have a big issue here. So the first step will be changing the generated code. But immediatly after that check for the differences in the DB and the application.

I know the importance of this. But thanks for the reply. Both of you.

I'll try it 2morrow at the office.

Many thanks

Stephan
User
Posts: 63
Joined: 16-Jan-2007
# Posted on: 13-Nov-2008 14:55:33   

I don't know what I did wrong, I also tried this,, but it working now. Thanks Wallaa.

I will focus now on getting my DB in sync.

Thanks for the help guys.