Mapping to RAW type fields

2 posts, 0 answers
  1. Devanand Chahal
    Devanand Chahal avatar
    26 posts
    Member since:
    Mar 2009

    Posted 24 Feb 2010 Link to this post

    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
  2. Ady
    Admin
    Ady avatar
    588 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" />
                  </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.
  3. DevCraft banner
Back to Top