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. Database & SysAdmin
  3. Database
  4. How to determine what DB is used

How to determine what DB is used

Scheduled Pinned Locked Moved Database
databasecssmysqlsql-servertutorial
6 Posts 4 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
    Programm3r
    wrote on last edited by
    #1

    Hi all, Is it possible to determine what db is being used with a sql statement or something more or less the same. i.e. Be it MySQL, MSSQL, DB2 .... Many thanx .... again. Regards,

    The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r

    P J 2 Replies Last reply
    0
    • P Programm3r

      Hi all, Is it possible to determine what db is being used with a sql statement or something more or less the same. i.e. Be it MySQL, MSSQL, DB2 .... Many thanx .... again. Regards,

      The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r

      P Offline
      P Offline
      Paddy Boyd
      wrote on last edited by
      #2

      How do you mean? Surely if you are hitting the DB, then you will have access to the connection object which would have this info?

      P 1 Reply Last reply
      0
      • P Paddy Boyd

        How do you mean? Surely if you are hitting the DB, then you will have access to the connection object which would have this info?

        P Offline
        P Offline
        Programm3r
        wrote on last edited by
        #3

        Yes you are correct ... but I have no idea how to retrieve that object ?

        The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r

        C 1 Reply Last reply
        0
        • P Programm3r

          Yes you are correct ... but I have no idea how to retrieve that object ?

          The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r

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

          Programm3r wrote:

          but I have no idea how to retrieve that object ?

          In order to connect to a database you must need some sort of connection. That connection object will have a IDbConnection.ConnectionString[^] property implementation from the IDbConnection interface. (So it doesn't matter what type of Connection object you have, you can always access it through the interface)


          Upcoming Scottish Developers events: * Glasgow: Tell us what you want to see in 2007 My: Website | Blog | Photos

          1 Reply Last reply
          0
          • P Programm3r

            Hi all, Is it possible to determine what db is being used with a sql statement or something more or less the same. i.e. Be it MySQL, MSSQL, DB2 .... Many thanx .... again. Regards,

            The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r

            J Offline
            J Offline
            jezemine
            wrote on last edited by
            #5

            in MSSQL: select db_name()


            www.elsasoft.org

            P 1 Reply Last reply
            0
            • J jezemine

              in MSSQL: select db_name()


              www.elsasoft.org

              P Offline
              P Offline
              Programm3r
              wrote on last edited by
              #6

              Many thanx for the response, If I run select db_name() it returns the name of the database, the thing I looking for is the actual database package name, like MSSQL or MySQL, does it make sense, is it possible? Regards,

              The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r

              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