Best Approach on data access

Page 1 of 2 12 LastLast
  1. #1

    Best Approach on data access

    Hello,

    First of all great job!

    After looking at your examples I've seen a lot of different possibilities to access a database, some better than the other. The problem I have now (also because I'm rather new on ASP.NET) is I don't know anymore what is the best approach. I really like the approach on the datacontext (linq to sql) but in your samples this is only used to retrieve data. In the samples for saving data and such you use a regular sqldatasource embedded in the aspx file.

    I want to do the following: having a grid listing all my records, below that grid a tabpanel with a general tab that presents a form to edit the selected record (see attachment).

    I was wondering what is the best approach on data access to do the updating, inserting and deleting of a record, in combination with coolite.
    To be honest I don't like the inline sqldatasource but rather the dbml approach, because I want to use these entities later on in other screens.

    Another problem I have is that when I want to save the record, I've kind of lost my GUID key...

    Thanks in advance for helping me out.

    Kind regards,

    Reno
  2. #2

    RE: Best Approach on data access



    After investigating a little more I have chosen to create my own Entity (not using LINQ to SQL).
    Than I use a ObjectDataSource instead of the other kind of datasources.
    In this ObjectDataSource you can define your selectmethod, insertmethod, updatemethod and deletemethod.

    What I don't get at this moment is when I fill my General form below with the details of the selected row, how I should do the update. Can the defined ObjectDataSource be used to do this? Or just do ajax postback and instantiate my entity class and do an update as such... And if so, how do I pass my guid (key) or where do I store it intermediate without showing it in a textfield...

    Thanks in advance

    Reno
  3. #3

    RE: Best Approach on data access

    Hi,

    1. If need example how to save with LINQ then you can investigate examples in "GridPanel\WebService connections" branch
    2. About saving form fields. You can update grid record and call save function for GridPanel. Also you can initiate ajax request, grab values from form fields on server-side and save them to the DB


    I think the following examples can be useful for you


    https://examples1.ext.net/#/GridPanel/Miscellaneous/Details_Window/

    https://examples1.ext.net/#/GridPanel/Miscellaneous/Details_Window_Remote/



  4. #4

    RE: Best Approach on data access

    *Hello,

    Thanks for your reply.


    One more question, how can I select a row in the grid based upon my key?


    Thanks!


    Reno
  5. #5

    RE: Best Approach on data access

    Once again:

    I've found my question above, by using this:
    <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">
    </p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">			rowselectionmodelTechnologies.SelectedRows.Clear();</p>
    <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">			rowselectionmodelTechnologies.SelectedRows.Add(new SelectedRow(tech.GUID.ToString()));</p>
    <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica">			rowselectionmodelTechnologies.UpdateSelection();</p>


    But when my record is on the second page eg. than this is not selected.


    Any solution on this?



  6. #6

    RE: Best Approach on data access

    Hi,

    First you need to set id field *as ReaderID in Reader object (Store->Reader)


    If you need to select on server side then use SelectedRows collection in SelectionModel
    https://examples1.ext.net/#/GridPanel/Selection_Models/Row_Selection/



    If need select on client-side
    grid.getSelectionModel().selectRow(grid.store.inde xOfId(recordID));




  7. #7

    RE: Best Approach on data access

    *Thanks,

    That is what I found, but yet I have the problem that when paging is active, and I (programmatically) select a row that is located in the second (or third..) page while I'm on the first page, that row doesn't get selected. He doesn't go to that page.


    Is there a solution for this?


    Thanks,


    Reno
  8. #8

    RE: Best Approach on data access

    You must set required page manually before select a row

  9. #9

    RE: Best Approach on data access

    *And how do I know the required page?

    Thanks!


    (If I'm bugging too much, just tell me ;-))
  10. #10

    RE: Best Approach on data access

    Hi,

    Please see *the following topic, it should help

    http://forums.ext.net/showthread.php...6828-16-1.aspx




Page 1 of 2 12 LastLast

Similar Threads

  1. [CLOSED] Access to selected gridpanel row data
    By HOWARDJ in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 11, 2011, 7:07 AM
  2. Replies: 1
    Last Post: Feb 17, 2010, 9:38 AM
  3. Is there anything wrong with this JSON approach?
    By michaeld in forum 1.x Help
    Replies: 1
    Last Post: Sep 11, 2009, 12:23 PM
  4. Best approach to absolute positioning of controls?
    By dbassett74 in forum 1.x Help
    Replies: 5
    Last Post: May 11, 2009, 6:28 PM
  5. [CLOSED] Linked comboboxes, best approach
    By reinout.mechant@imprss.be in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Mar 25, 2009, 5:16 AM

Posting Permissions