SQLServer 2008 data type

2 posts, 0 answers
  1. Jonathan Simmons
    Jonathan Simmons avatar
    107 posts
    Member since:
    Jun 2005

    Posted 24 Mar 2009 Link to this post

    Hi,
    I have an important SQLServer 2008 project which is giving issues with unsupported data types. A number of columns are of the data type 'DATE' which OpenAccess maps to System.String. This is causing a issues in the controls and code for the web application and I don't want to changes the data type in the tables to DateTime and then try to rebuild the OA layer (many problems with this).

    I see in the OA Backend Configuration Settings dialog that it is possible to change the mapped types but DATE does not appear in the list of SQL types to pick from (which I guesss is why OA defaults the conversion to string). Is it possible to add the DATE SQLServer data type to the drop down to pick from to allow me to map this to a System.DateTime? Or is this hardcoded into one of the DLLs?

    I'm happy to do this as SQLServer implicitly converts a DateTime to a Date and stores the correct values.

    Regards,
    Jonathan
  2. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 26 Mar 2009 Link to this post

    Hello Jonathan Simmons,
    The reverse engineering calculation for 'Date' is hard coded. One workaround at the moment is that you change the mapping by hand after the reverse engineering wizard does generate everything.

    The mapping nodes have to have this entry:
              <class name="Person">  
                <field name="birthday">  
                  <extension key="db-column">  
                    <extension key="db-sql-type" value="DATE" /> 
                  </extension> 
                </field> 
              </class> 
     
    And the field and property type in your classes must be changed to DateTime.

    Another workaround is to have a copy of your schema, change all date to datetime and use this for reverse engineering. During runtime you can use your original schema.

    We will add the date mapping to the reverse egnineering wizard.

    Greetings,
    Jan Blessenohl
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  3. DevCraft banner
Back to Top