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. What is the point of using .NET data sources?

What is the point of using .NET data sources?

Scheduled Pinned Locked Moved ASP.NET
2 Posts 2 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.
  • D Offline
    D Offline
    DaveRRR
    wrote on last edited by
    #1

    What is the point of using data sources such as SqlDataSource or ObjectDataSource?

    Consider a simple example of a web page with a dropdown list used to filter the content of a pageable, sortable GridView. Each control needs a data source and that results in two calls to SQL Server. We are also told to keep the number of "round trips" to SQL Server to a minimum, for best performance. These scenarios are incompatible (although the difference in my example is trivial).

    The only solution I have spotted is to make a single call to a compound SQL Server stored procedure and to put the results in a dataset (a repeater cannot be used for a pageable, sortable GridView) and bind each control to the appropriate table in the dataset. The disadvantage to this method is that I now have to code the GridView Sorting and PageIndexChanging events rather than just supplying attributes for that control.

    Dave

    K 1 Reply Last reply
    0
    • D DaveRRR

      What is the point of using data sources such as SqlDataSource or ObjectDataSource?

      Consider a simple example of a web page with a dropdown list used to filter the content of a pageable, sortable GridView. Each control needs a data source and that results in two calls to SQL Server. We are also told to keep the number of "round trips" to SQL Server to a minimum, for best performance. These scenarios are incompatible (although the difference in my example is trivial).

      The only solution I have spotted is to make a single call to a compound SQL Server stored procedure and to put the results in a dataset (a repeater cannot be used for a pageable, sortable GridView) and bind each control to the appropriate table in the dataset. The disadvantage to this method is that I now have to code the GridView Sorting and PageIndexChanging events rather than just supplying attributes for that control.

      Dave

      K Offline
      K Offline
      kubben
      wrote on last edited by
      #2

      The objectDataSource is a very tool. It allows you to bind collection of objects to a gridview instead of always using a dataset or a datatable, dataview. I wrote and article on the objectdatasource and the gridview. Take a look at it and let me know what you think? http://www.codeproject.com/useritems/GridViewObjectDataSource.asp[^] I am currently using something close to what I showed in this article in production now. The objects and the gridview it self are a lot more complex, but the basic function is the same. Ben

      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