issues with db returned field type through odata3

2 posts, 0 answers
  1. Maor
    Maor avatar
    50 posts
    Member since:
    Dec 2012

    Posted 17 Oct 2013 Link to this post

    hi guys.
    i am working on simple kendo mobile app. in order to consume web services i use openaccess platform as described in : using kendo with
     open access
       .
    works fine but here it is the cons(may be i do something wrong and here i need your help):
    1) i cant configure listview endless scroll or "press to load more", even after folowing kendo demos and defining serverPaging and pageSize.
    2) the tutorial in the link above describe how to set wcf odata v3 but kendo dataSource support odata v2 so i "downgrade" my server to support odata v2.
    3) the major problem: i have field in the DB which define as time(7) type. after modeling it in vs2010 and openaccess i see the table with the field as type dateTime. in the generated model files i found the field as date.. when consuming the service i get the field with 2 hours difference from what stored in the db.. 

    any suggestions and tips will be great.
    regards ,
    maor
  2. Kristian Nikolov
    Admin
    Kristian Nikolov avatar
    206 posts

    Posted 21 Oct 2013 Link to this post

    Hi Maor,

    Your first two questions are not related to Open Access but to Kendo UI. Please post them in the corresponding forums with more detailed information about the problems that you are experiencing and the code that you are currently using. As general information I can say that you can still use OData version 3 with the dataSource by overriding the default schema data and total functions:
    schema: {
        data: function (data) {
            if (data.value) {
                return data.value;
            }
            delete data["odata.metadata"];
            return [data];
        },
        total: function (data) {
            return data["odata.count"];
        }

    As for your third question - by default OpenAccess ORM maps the Time SQL type to the DateTime CLR type (Date is a shortcut to DateTime in VB.NET). The reason for that is that the Time SQL type can be interpreted as a single point in time while the TimeSpan type represents the difference between two points in time. This behavior is normal and should not be a cause for concern.

    Unfortunately we were not able to reproduce the problem you described. In the sample I sent you in your product feedback ticket with id 736177, the retrieved SmokingHour value is the same as the one stored on the server. Could you please confirm if there is difference between the timezones on the server side and application side? Also please check if you have enabled Use UTC for DateTime in your model settings.

    We are looking forward to your feedback.

    Regards,
    Kristian Nikolov
    Telerik
    OpenAccess ORM Q3 2013 Beta is available for immediate download in your account. Get it now and play with the latest bits. See what's new >>
  3. DevCraft banner
Back to Top