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. how to check database is available before open the connection?

how to check database is available before open the connection?

Scheduled Pinned Locked Moved ASP.NET
databasecomhelptutorialquestion
6 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.
  • P Offline
    P Offline
    Piyush Vardhan Singh
    wrote on last edited by
    #1

    hello friend how to check database is available before open the connection object? Please help me. Thanks

    Piyush Vardhan Singh p_vardhan14@rediffmail.com Eventure Technology http://holyschoolofvaranasi.blogspot.com http://holytravelsofvaranasi.blogspot.com

    B A 2 Replies Last reply
    0
    • P Piyush Vardhan Singh

      hello friend how to check database is available before open the connection object? Please help me. Thanks

      Piyush Vardhan Singh p_vardhan14@rediffmail.com Eventure Technology http://holyschoolofvaranasi.blogspot.com http://holytravelsofvaranasi.blogspot.com

      B Offline
      B Offline
      Blue_Boy
      wrote on last edited by
      #2

      How do you mean by

      Piyush Vardhan Singh wrote:

      how to check database is available

      Do you mean checking if exists database before open it? If yes then try this query select * From sysdatabases where [name]='yourdbname'


      I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

      1 Reply Last reply
      0
      • P Piyush Vardhan Singh

        hello friend how to check database is available before open the connection object? Please help me. Thanks

        Piyush Vardhan Singh p_vardhan14@rediffmail.com Eventure Technology http://holyschoolofvaranasi.blogspot.com http://holytravelsofvaranasi.blogspot.com

        A Offline
        A Offline
        Abhijit Jana
        wrote on last edited by
        #3

        Piyush Vardhan Singh wrote:

        how to check database is available before open the connection object?

        So you want to make sure database exist or not with out connecting the database? :doh:

        Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you. View My Latest Article

        P 1 Reply Last reply
        0
        • A Abhijit Jana

          Piyush Vardhan Singh wrote:

          how to check database is available before open the connection object?

          So you want to make sure database exist or not with out connecting the database? :doh:

          Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you. View My Latest Article

          P Offline
          P Offline
          Piyush Vardhan Singh
          wrote on last edited by
          #4

          thanks for reply i want to avoid network failures error.when network is not available. so i want check database is available before open the connection object

          Piyush Vardhan Singh p_vardhan14@rediffmail.com Eventure Technology http://holyschoolofvaranasi.blogspot.com http://holytravelsofvaranasi.blogspot.com

          A 1 Reply Last reply
          0
          • P Piyush Vardhan Singh

            thanks for reply i want to avoid network failures error.when network is not available. so i want check database is available before open the connection object

            Piyush Vardhan Singh p_vardhan14@rediffmail.com Eventure Technology http://holyschoolofvaranasi.blogspot.com http://holytravelsofvaranasi.blogspot.com

            A Offline
            A Offline
            Abhijit Jana
            wrote on last edited by
            #5

            Piyush Vardhan Singh wrote:

            want to avoid network failures error.when network is not available.

            You have to taking care of Connection Time out For this . If the connection is not available you will get an Timeout Excepation :-D

            Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you. View My Latest Article

            P 1 Reply Last reply
            0
            • A Abhijit Jana

              Piyush Vardhan Singh wrote:

              want to avoid network failures error.when network is not available.

              You have to taking care of Connection Time out For this . If the connection is not available you will get an Timeout Excepation :-D

              Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you. View My Latest Article

              P Offline
              P Offline
              Piyush Vardhan Singh
              wrote on last edited by
              #6

              YES but i want to handle this without error?

              Piyush Vardhan Singh p_vardhan14@rediffmail.com Eventure Technology http://holyschoolofvaranasi.blogspot.com http://holytravelsofvaranasi.blogspot.com

              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