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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. To many SQL Data Sources?

To many SQL Data Sources?

Scheduled Pinned Locked Moved Database
databasecsharpasp-nettutorialquestion
3 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.
  • D Offline
    D Offline
    Drathmar
    wrote on last edited by
    #1

    I'm still pretty new to the Asp.Net world. I have a website that a user will have to fill out some forms. Several of these forms I want the entries to be standardized into drop down boxes. (for intstance, ethnicity) I'd like to be able to pull values from an 'ethnicty' table and well several other tables for other drop down boxes. How ever I have a concern, how many sqldatasource objects is to many? (Is it common practice to use as many as 10 different sql data sources on the same webpage?) How well does the .net code optimize these data sources? For example, on each datasource does it open a connection, run the query then close connection for all 10 sources? In general, if I ran the queries on page load and then set the values of the drop down boxes would/could that be more efficient? Or are there a better places than page_load to do that?? Any info on these questions would be greatly appreciated, thanks Drathmar

    C M 2 Replies Last reply
    0
    • D Drathmar

      I'm still pretty new to the Asp.Net world. I have a website that a user will have to fill out some forms. Several of these forms I want the entries to be standardized into drop down boxes. (for intstance, ethnicity) I'd like to be able to pull values from an 'ethnicty' table and well several other tables for other drop down boxes. How ever I have a concern, how many sqldatasource objects is to many? (Is it common practice to use as many as 10 different sql data sources on the same webpage?) How well does the .net code optimize these data sources? For example, on each datasource does it open a connection, run the query then close connection for all 10 sources? In general, if I ran the queries on page load and then set the values of the drop down boxes would/could that be more efficient? Or are there a better places than page_load to do that?? Any info on these questions would be greatly appreciated, thanks Drathmar

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      Drathmar wrote:

      How ever I have a concern, how many sqldatasource objects is to many? (Is it common practice to use as many as 10 different sql data sources on the same webpage?)

      I wouldn't use any at all on a web page. I'd create a proper DAL (Data Abstraction Layer) and access the database through that and only that.


      Scottish Developers events: * .NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog

      1 Reply Last reply
      0
      • D Drathmar

        I'm still pretty new to the Asp.Net world. I have a website that a user will have to fill out some forms. Several of these forms I want the entries to be standardized into drop down boxes. (for intstance, ethnicity) I'd like to be able to pull values from an 'ethnicty' table and well several other tables for other drop down boxes. How ever I have a concern, how many sqldatasource objects is to many? (Is it common practice to use as many as 10 different sql data sources on the same webpage?) How well does the .net code optimize these data sources? For example, on each datasource does it open a connection, run the query then close connection for all 10 sources? In general, if I ran the queries on page load and then set the values of the drop down boxes would/could that be more efficient? Or are there a better places than page_load to do that?? Any info on these questions would be greatly appreciated, thanks Drathmar

        M Offline
        M Offline
        mysorian
        wrote on last edited by
        #3

        You should try looking at 'Factory' class which gives you an idea how to write database agnostic [generic] code.

        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