Different Data Types then Default Data Types

3 posts, 0 answers
  1. Riyasat
    Riyasat avatar
    2 posts
    Member since:
    Dec 2013

    Posted 13 Jul 2014 Link to this post

    I am trying to use Data Access with MySQL. My scenario is DB First. I am having few issues

    1- when I use Telerik Data Access Domain Model, at the last step where we can choose Mapping type there I selected Xml but it always generate customer.generated.cs file no XML in it.

    2- Is there a possibility to provide custom data type during the wizard, e.g I have in MySQL column type binary(16) which is being used for storing the GUIDs and they are being used as primary key which also have foreign key references, but when I use Telerik ORM it takes it as byte[] which is default behavior of DA. The question is can I specify somewhere that if binary(16) comes in then treat it as System.GUID ?


  2. Riyasat
    Riyasat avatar
    2 posts
    Member since:
    Dec 2013

    Posted 13 Jul 2014 in reply to Riyasat Link to this post

    Well I have found the solution to my problem. Thanks to Telerik Open Access / Data Access. In case if some one else is in same situation and come to this forum here is what I did.

    1- Generated rling from the default t4template
    2- Right click in empty space of Visual Designer
    3- Select Model Operations
    4- Select Members from Display Mode
    5- Click on Advanced Search checkbox that is just in front of the Reset (Blue color)
    6- Select SQL Type you want to change (in my case I selected binary)
    7- In the right most box (Operation) select Change CLR Type
    8- From the settings -> Set CLR Type To <-- here you select the targeted type (in my case it was GUID)
    9- Select all the entities in the middle box
    10- Finally click on execute

    and here you go now, if you added new table or column or changed something to that field you might need to do the same process again.

    Happy Coding..


  3. DevCraft banner
  4. Kristian Nikolov
    Kristian Nikolov avatar
    206 posts

    Posted 16 Jul 2014 Link to this post

    Hello Riyasat,

    We are glad you have resolved your situation and thank you for providing this information for other users that might be interested.

    As for your first question about XML mapping - this option specifies what will be the mapping for the model. The XML for the mapping is actually generated in the .rlinq file itself to keep the code of the persistent classes as clean as possible. Note that editing the XML in the .rlinq directly is not recommended.

    I hope this helps. Should you have additional questions feel free to post at our forums again.

    Kristian Nikolov
    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
Back to Top