Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. ObjectDataSource design question

ObjectDataSource design question

Scheduled Pinned Locked Moved ASP.NET
databasequestioncsssql-serverdesign
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    imak
    wrote on last edited by
    #1

    I have a web page where I need to diplay some data that is retrieved tbough an ObjectDataSource. Behind the scense ObjectDataSource is populated through a SQL server stored procedure ( let's say GetData() ). This stored procedure returns around 10K rows and depending upon some criteria I need to dipaly this data in three different Grid view controls. My questions is 1. How can I split data in one recordset that can be used in these three grid views. 2. Is there any better way of doing it rahter than using objectDataSource. Any specific links and example code will be highly appreciated. TIA

    P 1 Reply Last reply
    0
    • I imak

      I have a web page where I need to diplay some data that is retrieved tbough an ObjectDataSource. Behind the scense ObjectDataSource is populated through a SQL server stored procedure ( let's say GetData() ). This stored procedure returns around 10K rows and depending upon some criteria I need to dipaly this data in three different Grid view controls. My questions is 1. How can I split data in one recordset that can be used in these three grid views. 2. Is there any better way of doing it rahter than using objectDataSource. Any specific links and example code will be highly appreciated. TIA

      P Offline
      P Offline
      pmarfleet
      wrote on last edited by
      #2

      imak wrote:

      1. How can I split data in one recordset that can be used in these three grid views.

      How do you want to split the data? By a specific number of rows? You could add some paging logic to your stored procedure to do this. If each grid view displays different types of data, you would need to write separate stored procedures.

      imak wrote:

      2. Is there any better way of doing it rahter than using objectDataSource.

      The ObjectDataSource control allows data-bound controls to bind to custom objects/collections of custom objects. If you just want to bind a control to the results of a SQL Server query, use the SqlDataSource control.

      Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

      R 1 Reply Last reply
      0
      • P pmarfleet

        imak wrote:

        1. How can I split data in one recordset that can be used in these three grid views.

        How do you want to split the data? By a specific number of rows? You could add some paging logic to your stored procedure to do this. If each grid view displays different types of data, you would need to write separate stored procedures.

        imak wrote:

        2. Is there any better way of doing it rahter than using objectDataSource.

        The ObjectDataSource control allows data-bound controls to bind to custom objects/collections of custom objects. If you just want to bind a control to the results of a SQL Server query, use the SqlDataSource control.

        Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

        R Offline
        R Offline
        ram1974
        wrote on last edited by
        #3

        Hi, * As paul said you can implement paging logic so, that the Ods is not heavy. * why are you complecating the things? why don't you use 3 ods for 3 grid views -Ram.

        I 1 Reply Last reply
        0
        • R ram1974

          Hi, * As paul said you can implement paging logic so, that the Ods is not heavy. * why are you complecating the things? why don't you use 3 ods for 3 grid views -Ram.

          I Offline
          I Offline
          imak
          wrote on last edited by
          #4

          Thanks Paul and Ram for your responses. I actually gave a simplified version of the actual problem. Let me provide detail so hopefully it will provide some clarification. There are actually 30 different web pages and number of grid ( and varios other controls) vary on each page (depending upon page, number of controls vary between 20 - 40). I am using objectDataSource as this product has multiple flavors that provides ability to connect to various types of data sources(SQL Server, oracle, mySQL etc). Now in order to populate all controls on one page I was trying to avoid going back and forth between database. That's why I do not want to bind individual controls with so many ods; rather return all possible rows in one stored procedure, Call this stored procedure to fetch all data and then on client side populate different controls by splitting data. Is this a reasonable design? If so, is it possible to split data within objectdatasource logic? If so, can you provide any code examples?

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups