How can I do this with Telerik Open Access

4 posts, 0 answers
  1. P
    P avatar
    2 posts
    Member since:
    Jun 2013

    Posted 12 Jul 2013 Link to this post

    Hi, I have more than one gridviews along with other controls in a telerik winforms application.  These grids are not directly connected to the database, when I add or remove entry (in grids), I do it in memory object. I only save it to the database (along with other values from other controls) when user press submit button. When I create a new entry, it’s not a problem. However, when user opens an existing entry to modify, then I have problem, let say users delete/modify an existing entry and add new entry (in grid), how can I update db table? I can delete related entries and create them all over again, but that doesn’t sounds like right approach. We are planning to use Open Access ORM for this project, so I am wondering is there an easy/better way of doing using OpenAccess.

    Thank you

  2. Boris Georgiev
    Admin
    Boris Georgiev avatar
    190 posts

    Posted 16 Jul 2013 Link to this post

    Hello,

    In order for us to understand your scenario and assist you in the best possible way, could you please provide us some more information:
    1) Are you using directly the classes that represent the tables in the database or you are using wrappers on them?

    2) Do you have server application and client application or it is a single client application which has a connection to the database?

    3) Do you have N-Tier application?
    3.1) What layers do you have?
    3.2) How you transfer the data between the layers - DTO, buddy classes or something else?

    4) Do you use any services - WebAPI, WCF, REST, etc.? 
    In case you are using services, I would suggest you to take a look at Telerik OpenAccess Samples Kit, we provide a sample "WCF Plain Services with Windows Forms" which demonstrates the best practices for using the Windows Forms and WCF Plain Services.

    I am looking forward to your feedback.

    Regards,
    Boris Georgiev
    Telerik
    OpenAccess ORM Q2 2013 brings you a more powerful code generation and a unique Bulk Operations support with LINQ syntax. Check out the list of new functionality and improvements shipped with this release.
  3. DevCraft banner
  4. P
    P avatar
    2 posts
    Member since:
    Jun 2013

    Posted 16 Jul 2013 Link to this post

    Hi Boris, thank you for getting back to me. Below is the answer to your query.

    1.Yes I am binding classes that represent the tables in the database, but they are disconnected. When users press save, object list will be populated with values from grid. 
    2.It does have server and client app, but at this point I am only concern with client and I want to save data to local database.
    3.I have presentation, BLL, data layer (for read/write) and yes I am passing  objects between the layers
    4.I am not using service for local operations in my client application, but I am open to the idea if there is benefit.

    Regards

     

  5. Boris Georgiev
    Admin
    Boris Georgiev avatar
    190 posts

    Posted 18 Jul 2013 Link to this post

    Hello,

    I have prepared a sample application which demonstrates how to add, delete and update objects using Telerik WinForms Controls, Telerik OpenAccess ORM and MSSQL Server as backend. The sample uses the SofiaCarRental database.
     
    In the sample, the context is created when the form is initialized and the context is disposed when the form is closed. Generally, to using a long-living context is not recommended, but in your case there will not be a problem. The reason is that when  a long-living context is used  there will be too much data stored in the cache, in your case, the data is loaded anyway in the cache. 

    I don't think there will be a benefit of using any services for local operations.

    I hope this sample will help you to design your application. If you need additional guidance or if you need any further assistance with OpenAccess ORM, please let us know.

    Regards,
    Boris Georgiev
    Telerik
    OpenAccess ORM Q2 2013 brings you a more powerful code generation and a unique Bulk Operations support with LINQ syntax. Check out the list of new functionality and improvements shipped with this release.
Back to Top