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. General Programming
  3. Visual Basic
  4. how to connect DSN server

how to connect DSN server

Scheduled Pinned Locked Moved Visual Basic
databasesysadminhelptutorialquestion
4 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.
  • I Offline
    I Offline
    iramg
    wrote on last edited by
    #1

    hello i have created a DSN server named "BLTPS" through control pannel ODBC service and using a userid and password property. now how i will connect to database through my code plz tell me which namespaces i have to add and what is the syntax. plz help me soon thanks

    J 1 Reply Last reply
    0
    • I iramg

      hello i have created a DSN server named "BLTPS" through control pannel ODBC service and using a userid and password property. now how i will connect to database through my code plz tell me which namespaces i have to add and what is the syntax. plz help me soon thanks

      J Offline
      J Offline
      Joshua Quick
      wrote on last edited by
      #2

      What you need to use is called ADO.NET. It's a collection of .NET classes under the System.Data namespace which allow you to work with various databases. This is a big subject and I highly recommend that you read up on this on MSDN. See the below link. You should also search this website and the Internet on this subject too. There's plenty of examples out there. http://msdn.microsoft.com/library/en-us/cpguide/html/cpconoverviewofadonet.asp[^] That said, you need to use the data provider classes under the System.Data.ODBC namespace. Read the above link to understand how to use them.

      I 1 Reply Last reply
      0
      • J Joshua Quick

        What you need to use is called ADO.NET. It's a collection of .NET classes under the System.Data namespace which allow you to work with various databases. This is a big subject and I highly recommend that you read up on this on MSDN. See the below link. You should also search this website and the Internet on this subject too. There's plenty of examples out there. http://msdn.microsoft.com/library/en-us/cpguide/html/cpconoverviewofadonet.asp[^] That said, you need to use the data provider classes under the System.Data.ODBC namespace. Read the above link to understand how to use them.

        I Offline
        I Offline
        iramg
        wrote on last edited by
        #3

        actuualy i have worked on oledb but not on ODBC. i have read a example in it they use ADODB but when i use it in my code it gives me error. there is no namespace of this name how i can use it plz tell me

        J 1 Reply Last reply
        0
        • I iramg

          actuualy i have worked on oledb but not on ODBC. i have read a example in it they use ADODB but when i use it in my code it gives me error. there is no namespace of this name how i can use it plz tell me

          J Offline
          J Offline
          Joshua Quick
          wrote on last edited by
          #4

          iramg wrote:

          i have read a example in it they use ADODB but when i use it in my code it gives me error.

          That's the old ADO library used by VB6 and older versions. To use ADO.NET, you need to add a reference to the System.Data.dll in your project. In Visual Studio 2003, you can do this by right clicking on your project's References folder, select Add References, select System.Data.dll in the listbox, click Select, and then click OK. This will give you access to the System.Data namespace and all of its classes. You'll need to use the System.Data.Odbc.OdbcConnection class to connect to the database. The below link to MSDN will show you a quick example on how to use this class. http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemDataOdbcOdbcConnectionClassTopic.asp[^] I hope this helps!

          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