handling user defined types (UDT)?

4 posts, 0 answers
  1. john
    john avatar
    1 posts
    Member since:
    May 2014

    Posted 21 May 2014 Link to this post

    i get this log when updating my database from data model

    -- Column was read from database as: [ACCT_CODE] 'ud_ACCT_CODE'(12) not null
    -- modify column for field _ACCT_CODE
    ALTER TABLE [ACCOUNT_BUDGET] ALTER COLUMN [ACCT_CODE] varchar(12) NOT NULL

    go

    how can i prevent it from replacing my user defined type?
  2. Doroteya
    Admin
    Doroteya avatar
    502 posts

    Posted 23 May 2014 Link to this post

    Hi John,

    In order to avoid unnecessary changes of the database, I would suggest to you to review the Select Changes page of the wizard and to uncheck those that you do not intend to persist. If this is not applicable in your scenario, another possibility is to select the Create Script File option on Summary Page and to edit the generated script before executing it.

    I hope this helps. In case you have additional questions, do not hesitate to get back to us.


    Regards,
    Doroteya
    Telerik
     
    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
     
  3. DevCraft banner
  4. Carlos
    Carlos avatar
    1 posts
    Member since:
    Apr 2015

    Posted 22 Jun 2015 in reply to Doroteya Link to this post

    Hi I got a problem check this :

      private int _usrIdIdt;
    [Column("usr_id_idt", OpenAccessType = OpenAccessType.Int32, IsBackendCalculated = true, IsPrimaryKey = true, Length = 0, Scale = 0, SqlType = "identificador")]
    [Storage("_usrIdIdt")]
    [System.ComponentModel.DataAnnotations.Required()]
    [System.ComponentModel.DataAnnotations.Key()]
    public virtual int UsrIdIdt
    {
    get
    {
    return this._usrIdIdt;
    }
    set
    {
    this._usrIdIdt = value;
    }
    }

     

    This is the PK of my table , but this SqlType = " ' identificador ' " property of the Column attribute , im getting problems when I tried to insert a new record , the problem is that DataAccess is incluiding single quotes when build de sql query and mssql rise and exception like this : Incorrect syntax near 'identificador' , identificador is a User Defined Datatype , my question is if there is a way to avoid que double single quotation in the property attribute ?

  5. Doroteya
    Admin
    Doroteya avatar
    502 posts

    Posted 24 Jun 2015 Link to this post

    Hi Carlos,

    I am sorry that you are experiencing issues.

    The support of Data Access for user-defined types is very limited, and it seems that the type of your primary key is out of its scope. To either confirm this or resolve the problem, I will ask you for your cooperation. Can you send me the script of the user-defined type to which the primary key is mapped?

    I am looking forward to your feedback.


    Regards,
    Doroteya
    Telerik
     
    Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
Back to Top