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. Web Development
  3. ASP.NET
  4. Connect to database between postback [modified]

Connect to database between postback [modified]

Scheduled Pinned Locked Moved ASP.NET
databasecsharpasp-net
3 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.
  • C Offline
    C Offline
    Civic06
    wrote on last edited by
    #1

    I have a form with many controls and on several of the controls there is a on leave handler added. where each one connects to db and does validation and disconnects. is there a way i can connect to the db only once and then when submit is hit...disconnect. so i don't have many connect disconnects. This is for ASP.net website form.

    modified on Friday, March 27, 2009 9:25 PM

    T 1 Reply Last reply
    0
    • C Civic06

      I have a form with many controls and on several of the controls there is a on leave handler added. where each one connects to db and does validation and disconnects. is there a way i can connect to the db only once and then when submit is hit...disconnect. so i don't have many connect disconnects. This is for ASP.net website form.

      modified on Friday, March 27, 2009 9:25 PM

      T Offline
      T Offline
      tech603
      wrote on last edited by
      #2

      You should try using a dataset instead of making mutiple calls to the database. When you use a dataset, you'll make one query to your database and populate the dataset with that information. At which point you can bind that data to your controls. The link below is the msdn article for working with Datasets. http://msdn.microsoft.com/en-us/library/system.data.dataset.aspx[^] hope this helps

      Matthew Vass QA Analyst mvass@hostmysite.com HostMySite.com

      C 1 Reply Last reply
      0
      • T tech603

        You should try using a dataset instead of making mutiple calls to the database. When you use a dataset, you'll make one query to your database and populate the dataset with that information. At which point you can bind that data to your controls. The link below is the msdn article for working with Datasets. http://msdn.microsoft.com/en-us/library/system.data.dataset.aspx[^] hope this helps

        Matthew Vass QA Analyst mvass@hostmysite.com HostMySite.com

        C Offline
        C Offline
        Civic06
        wrote on last edited by
        #3

        I can't use that because the reason i am making multiple calls is to validate the value in the text box control. So there are many controls that need validation..so on postback all this happens. Is there any other way ... to keep a global db connection open for that page till submit is hit.

        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