Mapping to RAW type fields

Thread is closed for posting
2 posts, 0 answers
  1. Devanand Chahal
    Devanand Chahal avatar
    26 posts
    Member since:
    Mar 2009

    Posted 24 Feb 2010 Link to this post


    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
  2. Ady
    Ady avatar
    589 posts

    Posted 01 Mar 2010 Link to this post

    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" />

    All the best,
    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.
Back to Top