RE: connecting VB dot Net to Oracle 8i
From: Mark (anonymous_at_discussions.microsoft.com)
Date: 03/30/04
- Next message: Cindy Winegarden: "Re: How do I add an index to a FoxPro table"
- Previous message: kiloez: "Sorting a recordset"
- In reply to: rbutch: "connecting VB dot Net to Oracle 8i"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 30 Mar 2004 07:21:07 -0800
Here's a code snippet. Try getting into C++. Good luck.
Don't forget to add a refrence to System.Data.
Dim strSource As String
Dim lpConnection As System.Data.OleDb.OleDbConnection
Dim UserID As String
Dim Password As String
Dim Source As String
'open the connection
UserID = "ORACLEUSER"
Password = "ORACLEPASSWORD"
Source = "ORACLESERVER"
lpConnection = New System.Data.OleDb.OleDbConnection
lpConnection.ConnectionString = "Provider=MSDAORA.1;User ID = " + UserID _
& ";Password = " + Password + ";Data Source = " + source _
& ";Persist Security Info = False"
lpConnection.Open()
'get the data
Dim lpAdapter As System.Data.OleDb.OleDbDataAdapter
Dim lpDataTable As New System.Data.DataTable
lpAdapter = New System.Data.OleDb.OleDbDataAdapter("select * from TABLE_NAME", lpConnection)
lpAdapter.Fill(lpDataTable)
MessageBox.Show(lpDataTable.Rows.Count)
- Next message: Cindy Winegarden: "Re: How do I add an index to a FoxPro table"
- Previous message: kiloez: "Sorting a recordset"
- In reply to: rbutch: "connecting VB dot Net to Oracle 8i"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|