This is a migrated thread and some comments may be shown as answers.

Mapping to RAW type fields

1 Answer 36 Views
LINQ (LINQ specific questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Devanand Chahal
Top achievements
Rank 2
Devanand Chahal asked on 24 Feb 2010, 03:40 PM
Hi,

I have field of type RAW in database. I need to map is to String type of .NET variable. When I am trying to fetch the records it is giving me "Specified cast is invalid" error.

While doing mapping from Telerik wizard I gave Type as VARCHAR and SQLType as RAW.

Please Help
Thanks

1 Answer, 1 is accepted

Sort by
0
Ady
Telerik team
answered on 01 Mar 2010, 06:18 PM
Hi Devanand Chahal,

 OpenAccess maps a RAW column to a byte[]. You can specify mapping as below (length of 20 is just an example) for your field and convert it to a System.String based on what the contents of the column are.

        <field name="rawcolfield">
              <extension key="db-column" value="oracle">
                <extension key="db-type" value="VARBINARY" />
                <extension key="db-column-name" value="RAWCOL" />
                <extension key="db-sql-type" value="RAW" />
                <extension key="db-length" value="20" />
              </extension>
        </field> 

All the best,
Ady
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
LINQ (LINQ specific questions)
Asked by
Devanand Chahal
Top achievements
Rank 2
Answers by
Ady
Telerik team
Share this question
or