Problem with string parameter when adding record(s) to database

Posts   
 
    
Nanako
User
Posts: 7
Joined: 21-Aug-2007
# Posted on: 04-Dec-2007 05:21:37   

Hi,

I'm using LLBLGen to generate code. It works fine, but there's a problem when I add a string value to database. Max length of the field is 500, but I only can add a string with max length 255. FYI: - I'm using LLBLGen v2.5 RC1. - Runtime library SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll 2.5.7.813. - Template group and .NET version: SelfServicing, .NET 2.0. - Database: SQL CE 3.1.

Please give me some instructions. Thanks in advance!

Regards, Nanako

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 04-Dec-2007 06:16:52   

Hi Nanako,

Could you please tell us:

  • the DataBase type of such field
  • the .Net Type, DB Type and _Length _properties of such field at LLBLGenPro Designer
David Elizondo | LLBLGen Support Team
Nanako
User
Posts: 7
Joined: 21-Aug-2007
# Posted on: 04-Dec-2007 07:38:36   

Hi daelmo,

This is exactly what the generator generated in file PersistenceInfoProvider.cs:

base.AddElementFieldMapping( "PartPictureEntity", "Memo", "Memo", true, (int)SqlDbType.NVarChar, 500, 0, 0, false, "", null, typeof(System.String), 6 );

Hope that clarify. Any idea about this?

Regards, Nanako

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 04-Dec-2007 08:53:28   

Would you please answer the following question?

daelmo wrote:

the .Net Type, DB Type and Length properties of such field at LLBLGenPro Designer

Just to eliminate the RC1 factor, could you try using the latest Demo of LLBLGen Pro v.2.5 ?

Nanako
User
Posts: 7
Joined: 21-Aug-2007
# Posted on: 04-Dec-2007 09:15:25   

Oops, sorry about the question!!!

The .NET type of that field is System.String, DBType is SqlDbType.NVarChar with length 500.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 04-Dec-2007 09:23:26   

Would you please try using the latest Demo of LLBLGen Pro v.2.5 ?

Nanako
User
Posts: 7
Joined: 21-Aug-2007
# Posted on: 04-Dec-2007 10:52:48   

Walaa wrote:

Would you please try using the latest Demo of LLBLGen Pro v.2.5 ?

Hi Walaa,

Yes, I did try the latest version of LLBLGen (v2.5 Final Nov 5th FYI), but the exception still occur. Is there other solution for this?

Regards, Nanako.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 04-Dec-2007 10:59:52   

If the entity name was PartPictureEntity, and the field name is Memo, what's the value of the following:

int maxLength = PartPictureEntity.Fields["Memo"].MaxLength

(EDIT) I think this might be a bug/limitation in SQL CE 3.1 Please check this out: http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=1797052&SiteID=17

Nanako
User
Posts: 7
Joined: 21-Aug-2007
# Posted on: 04-Dec-2007 11:42:27   

Hi Walaa,

Thank you for your suggestion. That's not LLBLGen's bug. I'll try another way.

Thank you again for helping me.

Best regards, Nanako.

Arthur
User
Posts: 11
Joined: 13-Dec-2007
# Posted on: 13-Dec-2007 04:17:59   

I have the same problem with this. I tried to insert a 300-character length string to database using SqlCeCommand and it worked. It's confused confused confused confused

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 13-Dec-2007 11:04:58   

Hi Arthur, please open a new thread for your issue and post more details about your setup and what exactly did you try. Thanks.