Here is my environment:
64-bit Operating System, x64 based processor Windows 10 Enterprise Visual Studio 2010 Oracle Client 64 11gR2 ODAC 64k ODAC 32k
The issue is I can't get Visual Studio 2010 connecting to Oracle 11g Database.
Tried Oracle.DataAccess.DLL from Oracle Client 64 11gR2, ODAC 64k and ODAC32k, no success.
Also tried to set .NET framework to 4 and 2, no luck.
Also tried System.Data.OracleClient, it complains abount 32bit and 64bit conflict
Any help would be appreciated.
Thanks
Imports Oracle.DataAccess.Client Partial Class _Default Inherits System.Web.UI.Page
Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
Dim oradb As String = "Data Source=CustomerDB;User ID=userid;Password=password"
Dim conn As New Oracle.DataAccess.Client.OracleConnection(oradb)
Response.Write(conn.Database.ToString())
Response.Write(conn.State.ToString)
conn.Open()
Dim sql As String = "select name from customer where CustID=1"
Dim cmd As New Oracle.DataAccess.Client.OracleCommand(sql, conn)
Dim dr As Oracle.DataAccess.Client.OracleDataReader = cmd.ExecuteReader()
dr.Read()
Response.Write(dr.Item("name"))
conn.Close()
conn.Dispose()
End Sub
End Class
Okay, I have now installed Oracle Client 32 bit as well and copied the Oracle.DataAccess.dll into the Bin folder, from where I have added the file as reference in the project.
And still receiving this error in the 3rd line of the code _conn.Open()_
– kkazi Jun 29 '16 at 02:29