This is a migrated thread and some comments may be shown as answers.

issues with db returned field type through odata3

1 Answer 26 Views
Web Services
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Maor
Top achievements
Rank 1
Maor asked on 17 Oct 2013, 06:15 AM
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

1 Answer, 1 is accepted

Sort by
0
Kristian Nikolov
Telerik team
answered on 21 Oct 2013, 04:26 PM
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 >>
Tags
Web Services
Asked by
Maor
Top achievements
Rank 1
Answers by
Kristian Nikolov
Telerik team
Share this question
or