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

Sample code for OpenAccessDataSource - Select/Update/Delete?

4 Answers 82 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Stanley
Top achievements
Rank 1
Stanley asked on 01 Jun 2012, 08:49 PM
I am trying to develope an "OpenAccessDataSource" class, instead of binding to certain DB, it will call out to external Web Services. Thus, I think I will need to implement CRUD functions something like:
     [OpenAccessDataObjectMethod(OpenAccessDataObjectMethodType.Select)]
     [OpenAccessDataObjectMethod(OpenAccessDataObjectMethodType.Update)]
     [OpenAccessDataObjectMethod(OpenAccessDataObjectMethodType.Delete)]

Cross reference - here is how the same is done for "ObjectDataSource":
http://www.codeproject.com/Articles/14110/MySQL-5-C-sample-code-using-ObjectDataSources

Thanks!

4 Answers, 1 is accepted

Sort by
0
Zoran
Telerik team
answered on 06 Jun 2012, 09:02 AM
Hi Stanley,

 You should still use the approach where you manually write your code calling the remote services. The datasource components provided out-of-the-box with OpenAccess (the OpenAccessDataSource and OpenAccessLinqDataSource) are only intended to work against a certain database server with connection string and model provided. 

What you can use to speed-up your development is the Add OpenAccess service or OpenAccess Ria Service wizards which can generate the service-layer for you. Calling that layer though from the client-side should be accomplished with manual code, which could be written in the Select/DeleteUpdate methods for an ObjectDataSource as an example.

All the best,
Zoran
the Telerik team
Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
0
Stanley
Top achievements
Rank 1
answered on 06 Jun 2012, 06:36 PM
Interesting, actually I came from "ObjectDataSource", because SP 2010 Visual Web Parts wizard in VS 2010 does not like it. On the other hand, I could successfully bind Telerik ASP.NET Ajax control with "OpenAccessDataSource". That is why I am asking...
Since it is a no-go, I will try other ways...
Thanks!

0
Milind Raje
Top achievements
Rank 1
answered on 27 Jun 2012, 02:31 PM
hi,
How do I select distinct values in OpenAccessDataSource?
Select="new ( distinct ID)"  for example doesn't work.
Thanks for your consideration
milind
0
Zoran
Telerik team
answered on 01 Jul 2012, 11:18 AM
Hello Stanley,

 Unfortunately, it is not possible to select complex projections with the OpenAccessDataSource since it uses the OQL query language and does not materialize projections to anonymous types. It is possible to achieve this goal using the OpenAccessLinqDataSource with a workaround though, but you should confirm if using the OpenAccessLinqDataSource is an option for you, or you can only use OpenAccessDataSource for the moment.

All the best,
Zoran
the Telerik team
OpenAccess ORM Q2'12 Now Available! Get your hands on all the new stuff.
Tags
Development (API, general questions)
Asked by
Stanley
Top achievements
Rank 1
Answers by
Zoran
Telerik team
Stanley
Top achievements
Rank 1
Milind Raje
Top achievements
Rank 1
Share this question
or