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. Oracle conection with VB.NET

Oracle conection with VB.NET

Scheduled Pinned Locked Moved Visual Basic
csharporaclequestion
2 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.
  • W Offline
    W Offline
    waldesro
    wrote on last edited by
    #1

    :omg:How cant I conect with oracle data base with VB.NET?

    M 1 Reply Last reply
    0
    • W waldesro

      :omg:How cant I conect with oracle data base with VB.NET?

      M Offline
      M Offline
      Mike Ellison
      wrote on last edited by
      #2

      You can use the Microsoft OLEDB provider for Oracle with the System.Data.OleDb objects; you can use the Microsoft native provider for Oracle with the OracleClient objects; or you can use Oracle's own .NET provider (I haven't used it so I'm not sure its object library). For OLEDB, you would use something like this code:

      Imports System.Data.OleDb

      Sub DoSomethingInOracle()
      '-- setup a connection string for Oracle
      '-- using the Microsoft OleDb provider
      Const kConnectionString = _
      "Provider=MSDAORA.1;User ID=myUser; Password=myPass;Data Source=myServer;"

      Dim conn As OleDbConnection        
      
      Try            
          '--establish the connection
          conn = New OleDbConnection(kConnectionString)            
          conn.Open()            
      
          '--do something useful with the connection;
          '-- probably setup an OleDbCommand object
          '-- to run a query, or execute a stored
          '-- procedure...
      
          ...
          
      Catch ex As Exception            
          '--do something with the exception
          ...
      
      Finally            
          '--close and dispose the OleDbConnection object
          conn.Dispose()        
      End Try        
      

      End Sub

      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