I just upgraded to 1.0.2005.1 and I'm looking forward to creating type converter classes using VS.Net 2003. I read the documentation and can't find anything related to this topic. There is a topic on creating type conversions using the designer, but the "Converter to use" drop down on the "New Type Conversion Input" dialog box seems to be empty. I assume this drop-down gets populated with type conversions we (customers) create, but I have no idea what interface to use, what to name the type conversion assembly, etc.
Does anyone have an example of a type conversion project/ class that they would be willing to share? If I am not looking in the right place for documentation, please let me know.
Any information on this topic would be much appreciated. Thanks!
Thank you so much!! The SDK documentation was extremely helpful and the code was very straight-forward.
One last question (hopefully): In the CanConvertTo() and CanConvertFrom() methods, is there a way that I can get information about the underlying database data types? For example, if a SQL Server column is of type of numeric(11,2), is there a way to get that information using the converter classes? I know I can specify length, precision and scale in the designer as a "filter", but it would be great to be able to obtain this information in the type converter classes.
Why would you want to use that info? The purpose of the converter is that it simply gets a value, and converts it. It doesn't know field data nor gets that data, so I'm afraid that info isn't available inside a typeconverter.
If you're going to use custom types in a typeconverter, it's recommended to place these type definitions in a different assembly, as that assembly has to be present in the TypeConverters folder in LLBLGen Pro's root folder when you load a project.
Well, I was hoping I wouldn't have to create a different type converter for every variation of the numeric data type in our database. After querying the system tables in our database I found that there are 17 distinct variations of the numeric data type (meaning different lengths, precision and scale). Some of these variations map to different .NET data types, depending on the precision and scale.
I'm going to play with using a single type converter (using the SDK code) and then use the designer to add new type conversion definitions. Maybe each type conversion definition can use the same type converter, but each can apply it's own filter based on the native data type, precision, scale, etc.
Thanks again for adding the type converter feature!
say you have a type A which is the .NET type of a DB value. you also have a destination type B which is the type you want that value of type A to have.
So if you get a value of type A, you convert it to value B. Though at the same time, you can convert back a value of type B to a value of type A.
Typically, you use a type converter which can deal with one type B and various types A. Like the shipped example converter which converts various numeric values (the types A) to a bool (type B). When the bool value has to be converted back to a type A, you'll get the type to convert to (the type A) in the ConvertTo method. So all info required is available, and you can probably use just 1 type converter for all your numeric variants
I am having the same problem with the type converter functionality. The link that you guys provided is not working anymore. Would it be possible to provide me the same project of type converter so that I can work on the solution?