need your help to connect and get data from oracle database
Posted: Thu 07 Mar 2013 23:59
Hello everyone
I'm new here, and new with vb.net and oracle
I've download dotConnect for Oracle and Installed it
I've oracle database with TNSNames.ora
I tried more time to connect to oracle 10g database using vb.net ver 10 with framework 3.4 and 4
I really need your help
how to connect to oracle database using vb.net
I tired this code but when I start the project, there is an error
the error is :
System.Data.OracleClient requires Oracle client software version 8.1.7 or greater.
This is the code I've tried but notworking Code:
Dim connString As String = "Data Source=(DESCRIPTION=" _
"(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=X.X.X.X)(PORT=1521)))" _
"(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=XXX)));" _
"User Id=XXX;Password=XXX;"
'Create connection
Dim con As New OracleConnection(connString)
Try
con.ConnectionString = connString
con.Open()
Console.WriteLine("Connected to Oracle.")
Catch ex As OracleException
Console.WriteLine("Error: " & ex.ToString())
Finally
' Close Connection
con.Close()
Console.WriteLine("Connection Closed")
End Try
-------------
This my TNSNames.ora I've got it from Toad for Oracle 9.7.2
HPUXx=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=xxxxx)
(PORT=1521)
)
(CONNECT_DATA=
(SERVER=dedicated)
(SERVICE_NAME=xxxxx)
)
)
HRx=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=xxxx)
(PORT=1521)
)
(CONNECT_DATA=
(SERVICE_NAME=xxxx)
)
)
NEWPRODx=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=xxxxxxx)
(PORT=1521)
)
(CONNECT_DATA=
(SERVICE_NAME=xxxx)
)
)
I really need your help to connect and get data from oracle database using sql
thanks
I'm new here, and new with vb.net and oracle
I've download dotConnect for Oracle and Installed it
I've oracle database with TNSNames.ora
I tried more time to connect to oracle 10g database using vb.net ver 10 with framework 3.4 and 4
I really need your help
how to connect to oracle database using vb.net
I tired this code but when I start the project, there is an error
the error is :
System.Data.OracleClient requires Oracle client software version 8.1.7 or greater.
This is the code I've tried but notworking Code:
Dim connString As String = "Data Source=(DESCRIPTION=" _
"(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=X.X.X.X)(PORT=1521)))" _
"(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=XXX)));" _
"User Id=XXX;Password=XXX;"
'Create connection
Dim con As New OracleConnection(connString)
Try
con.ConnectionString = connString
con.Open()
Console.WriteLine("Connected to Oracle.")
Catch ex As OracleException
Console.WriteLine("Error: " & ex.ToString())
Finally
' Close Connection
con.Close()
Console.WriteLine("Connection Closed")
End Try
-------------
This my TNSNames.ora I've got it from Toad for Oracle 9.7.2
HPUXx=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=xxxxx)
(PORT=1521)
)
(CONNECT_DATA=
(SERVER=dedicated)
(SERVICE_NAME=xxxxx)
)
)
HRx=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=xxxx)
(PORT=1521)
)
(CONNECT_DATA=
(SERVICE_NAME=xxxx)
)
)
NEWPRODx=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=xxxxxxx)
(PORT=1521)
)
(CONNECT_DATA=
(SERVICE_NAME=xxxx)
)
)
I really need your help to connect and get data from oracle database using sql
thanks