Web >> Development >> ASP.Net >> VB >>  How to connect to Oracle

Example 1 ========= Imports System Imports System.Data Imports System.Data.OracleClient Imports Microsoft.VisualBasic Class Sample Public Shared Sub Main() Dim oraConn As OracleConnection = New OracleConnection("Data Source=MyOracleServer;Integrated Security=yes;") Dim oraCMD As OracleCommand = New OracleCommand("SELECT CUSTOMER_ID, NAME FROM DEMO.CUSTOMER", oraConn) oraConn.Open() Dim myReader As OracleDataReader = oraCMD.ExecuteReader() Do While (myReader.Read()) Console.WriteLine(vbTab & "{0}" & vbTab & "{1}", myReader.GetInt32(0), myReader.GetString(1)) Loop myReader.Close() oraConn.Close() End Sub End Class