Sample code for OpenAccessDataSource - Select/Update/Delete?

5 posts, 0 answers
  1. Stanley
    Stanley avatar
    17 posts
    Member since:
    Feb 2008

    Posted 01 Jun 2012 Link to this post

    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!
  2. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 06 Jun 2012 Link to this post

    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!
  3. DevCraft banner
  4. Stanley
    Stanley avatar
    17 posts
    Member since:
    Feb 2008

    Posted 06 Jun 2012 Link to this post

    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!

  5. Milind Raje
    Milind Raje avatar
    37 posts
    Member since:
    May 2010

    Posted 27 Jun 2012 Link to this post

    hi,
    How do I select distinct values in OpenAccessDataSource?
    Select="new ( distinct ID)"  for example doesn't work.
    Thanks for your consideration
    milind
  6. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 01 Jul 2012 Link to this post

    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.
Back to Top
DevCraft banner