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. ADO.NET and DSN

ADO.NET and DSN

Scheduled Pinned Locked Moved Database
databasesysadminquestioncsharpvisual-studio
7 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.
  • R Offline
    R Offline
    Ray Cassick
    wrote on last edited by
    #1

    I have an odd question here for all you data-centric folks... Let's say that I am developing a webservice that will perform some actions on a SQL database. I am to the point where I am starting to code the data-centric portion of the service. I want to add a connection to my webservice, but find that I can't seem to reference a DSN. It looks to me like I have to reference the servername and database directly. Alot of this fancy ADO.NET integration into the IDE seems to me to look like they expect us to develop on the same system we are going to deploy on? If I am developing on a system where the servers name is 'Serv01' and use all the fancy IDE integration wizzards to set things up, then move to a deployment where I have no control over my server names, how if my app supposed to function? This is why I like DSNs. I can mandate what they are named, and as long as they reference a server that has the proper database that I need my app does not care. Am I the only one that sees this as a problem?

    N 1 Reply Last reply
    0
    • R Ray Cassick

      I have an odd question here for all you data-centric folks... Let's say that I am developing a webservice that will perform some actions on a SQL database. I am to the point where I am starting to code the data-centric portion of the service. I want to add a connection to my webservice, but find that I can't seem to reference a DSN. It looks to me like I have to reference the servername and database directly. Alot of this fancy ADO.NET integration into the IDE seems to me to look like they expect us to develop on the same system we are going to deploy on? If I am developing on a system where the servers name is 'Serv01' and use all the fancy IDE integration wizzards to set things up, then move to a deployment where I have no control over my server names, how if my app supposed to function? This is why I like DSNs. I can mandate what they are named, and as long as they reference a server that has the proper database that I need my app does not care. Am I the only one that sees this as a problem?

      N Offline
      N Offline
      notadood
      wrote on last edited by
      #2

      We got around this by storing the database server name and database name in the registry. It is set during the installation of the program on the end computer.

      R 1 Reply Last reply
      0
      • N notadood

        We got around this by storing the database server name and database name in the registry. It is set during the installation of the program on the end computer.

        R Offline
        R Offline
        Ray Cassick
        wrote on last edited by
        #3

        yesh, I understand that part, but then all the fancy wizzard stuff goes to hell. If it let you point to a DSN it could all be happy.

        P 1 Reply Last reply
        0
        • R Ray Cassick

          yesh, I understand that part, but then all the fancy wizzard stuff goes to hell. If it let you point to a DSN it could all be happy.

          P Offline
          P Offline
          Paul Riley
          wrote on last edited by
          #4

          To point to a DSN, you need to download OBDC.NET from Microsoft's site ODBC .NET Data Provider[^] and instead of using System.Data.OleDb... objects, you use Microsoft.Data.Odbc... objects. Remember that ODBC is a Windows thing but .NET is supposed to be as neutral as possible. Paul

          R 1 Reply Last reply
          0
          • P Paul Riley

            To point to a DSN, you need to download OBDC.NET from Microsoft's site ODBC .NET Data Provider[^] and instead of using System.Data.OleDb... objects, you use Microsoft.Data.Odbc... objects. Remember that ODBC is a Windows thing but .NET is supposed to be as neutral as possible. Paul

            R Offline
            R Offline
            Ray Cassick
            wrote on last edited by
            #5

            Well according to the download page this comes as part of Mdac 2.7, which is installed as part of .NET, so I should already have this. I'll take a look at it when I get back to the home office.

            P 1 Reply Last reply
            0
            • R Ray Cassick

              Well according to the download page this comes as part of Mdac 2.7, which is installed as part of .NET, so I should already have this. I'll take a look at it when I get back to the home office.

              P Offline
              P Offline
              Paul Riley
              wrote on last edited by
              #6

              Ray Cassick wrote: Well according to the download page this comes as part of Mdac 2.7 No, it says it requires MDAC 2.7 :) Trust me, I've been using it for a while. It lacks some of the wizards that OleDb uses, but that's only a good thing in my opinion. Paul

              R 1 Reply Last reply
              0
              • P Paul Riley

                Ray Cassick wrote: Well according to the download page this comes as part of Mdac 2.7 No, it says it requires MDAC 2.7 :) Trust me, I've been using it for a while. It lacks some of the wizards that OleDb uses, but that's only a good thing in my opinion. Paul

                R Offline
                R Offline
                Ray Cassick
                wrote on last edited by
                #7

                Well I'll give it a try then... Thanks.

                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