TypeConverter issue following migration

Posts   
 
    
Jamanga
User
Posts: 93
Joined: 21-Jul-2006
# Posted on: 17-Jun-2013 07:49:07   

Hi team

Congrats on the new release!

LLBLGEN 4.0 Rel May 15th, 2013 .Net Framework 4.0 C# Application Sybase ASE 15.7 LLBLGEN runtime framework, adapter

I migrated a project from 2.6 to 4.0 and generally it came across fine. The only issue I see is that the typeconversion information seems to have been lost.

It's only a few fields for this project, and all of them used the good old BooleanNumericConverter for converting from an integer to a bool value (unchanged from the 2.6 shipped assembly). When I select "TypeConverter To Use" in the designer for a field, I see some values for some datetypes (e.g. datetime -> DateTimeDateTimeUTCConverter) but nothing for an System.Int32 type (I was expecting to see the BooleanNumericConverter).

I checked out: http://llblgen.com/documentation/4.0/Designer/hh_start.htm#Functionality%20Reference/ProjectSettings.htm#typeconversions which mentions there should be a "Project -> Edit Type Conversion Definitions..." from the main menu, but I don't see this menu item within my project. I'm not sure if this is related.

Am I missing something obvious?

Cheers, James

Jamanga
User
Posts: 93
Joined: 21-Jul-2006
# Posted on: 17-Jun-2013 07:53:25   

I should have also mentioned, that none of the System.Int32 fields are optional (nullable), and have the following properties:

Max Length: 0 Precision: 10 Scale: 0

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 17-Jun-2013 09:20:40   

That menu reference is outdated, we'll correct that. The type conversion definitions are located in the Project settings.

that said, type conversion definitions are used to automate type converter assignment, so they're not needed to add type converters to mappings.

Could you attach a repro project (with just the table and entity) which reproduces what you're seeing? Thanks. If you want, I can move this thread to the helpdesk forum so you can safely attach it without anyone but us reading it.

Frans Bouma | Lead developer LLBLGen Pro
Jamanga
User
Posts: 93
Joined: 21-Jul-2006
# Posted on: 18-Jun-2013 03:21:39   

Hi Frans

No worries re: menu. I found the TypeConverters area and added the BooleanNumericConverter to System.Int32 but it still didn't work. I also tried removing and re-adding the entity via the Catalog Explorer, but it made no difference.

It's fine not to make this post private, I don't have anything to hide wink

Attached is the schema and llbl project.

The relevant entity is CrawlEntity, properties: "Active" and "Approved" (integers who I want to represent as System.Boolean)

Please let me know if you need anything else.

Attachments
Filename File size Added on Approval
TVProgrammingDA.zip 10,230 18-Jun-2013 03:22.00 Approved
daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 18-Jun-2013 08:15:19   

It works just fine here. To recap, if you want your Int field to be bool, do this:

  1. Edit your entity and select the field.
  2. Change the type to bool (System.Boolean).
  3. Go to 'Field Mappings' sub-tab and select the field there (it should be in an error state, because the types don't match).
  4. Select the BooleanNumericTypeConverter in the TypeConverterToUse column.

If you define a type conversion in the Project->Setting->TypeConversions menu, then the steps 3 and 4 are applied automatically. The Type conversion should be defined as Int32 to use the BooleanNumericTypeConverter.

David Elizondo | LLBLGen Support Team
Jamanga
User
Posts: 93
Joined: 21-Jul-2006
# Posted on: 18-Jun-2013 09:09:18   

Hi Daelmo

You are right - damn. I thought it would work as per 2.x where when you set the converter the .NET type changes automatically.

Sorry for the inconvenience, and thanks for the step by step.