0

I've been beating my head against the wall for far too long on this.

What is the code to connect to an Oracle table through Visual Studio 2019 - using Visual Basic?

On a form load event, I want to connect to Oracle, and import the data from a specific table and then paste it into a new Excel file.

------------------------------------------------------------------------

Imports System.Data
Imports Microsoft.Office.Interop.Excel

Public Class ImportForm
Private Sub ImportForm_Load(sender As Object, e As System.EventArgs) Handles Me.Load
          Dim conn As New OleDbConnection("Data Source=123.123.1.12:1521;User Id=test")  'fake data
          conn.Open()
             (select data and put into Excel)
          conn.Dispose()
     End Sub 
End Class
Ken White
  • 123,280
  • 14
  • 225
  • 444
Magestik7
  • 1
  • 1
  • 2
    https://www.connectionstrings.com/ – OldProgrammer Jan 11 '21 at 00:55
  • 1
    It's not for us to just give you the code for whatever you want to do. You don't "connect to a table". You connect to a database, query a table and then do whatever you want to with the results of that query. They are three separate things, although the first two are closely related, so you can research them independently. Once you have done your research and made an attempt to implement what you've learned, you can then ask us specific questions if it doesn't work as you expect. You have only attempted the first part so far and haven't even told us whether it worked at all. Try again. – jmcilhinney Jan 11 '21 at 04:36
  • 1
    Also see: [How to connect to Oracle 11 database from . net](https://stackoverflow.com/questions/34803106/how-to-connect-to-oracle-11-database-from-net) – Xingyu Zhao Jan 11 '21 at 07:58

0 Answers0