Subscribe

RSS Feed (xml)

Connecting to Oracle

Use the .NET data provider for Oracle, which is in the


System.Data.OracleClient


namespace. This data provider does not come with .NET 1.0, but must be downloaded


separately. Working with Oracle connections is similar to working with SQL Server connections,


as the following code demonstrates:


Dim connectString As string =


"Data Source=Oracle-Test;User ID=user;Password=pass"


Dim myConn As OracleConnection = New OracleConnection( connectString )



Try




myConn.Open()


//do something and then be sure to close the connection...


Finally


If Not myConn Is Nothing Then


myConn.Close()


End Try


Comments


As with the SqlClient data provider, the Oracle data provider offers significant performance


benefits over the OleDB connection method.




Technorati :

No comments:

Archives

Variety in the Web World