Data Projection with Custom Type Converter?

Posts   
 
    
Emmanuel
User
Posts: 167
Joined: 13-Jan-2006
# Posted on: 24-Jul-2007 21:04:17   

I just changed some data types in my db from ntext to image using a StringToImage type converter that I just wrote.

Everthing works fine except that the change broke one thing: a data projection to a custom class in my app. Some of the previously ntext fields projected into my class are now of type image (and, therefore, of type Byte[] by default) which breaks the projection.

I guess the obvious solution would be to change my class so that members can be initialized with a type Byte[] but I'm wondering if there is another way to do this so that my app need not be aware of the Byte[]-to-String conversion that occurs behind the scenes everywhere else in the app.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 25-Jul-2007 09:32:36   

Projection should be done with matched dataTypes, so I think you should change the property of your custom class to be of byte[] type.

Emmanuel
User
Posts: 167
Joined: 13-Jan-2006
# Posted on: 28-Jul-2007 19:20:42   

OK. Thanks.