Developers community number 1 connection string reference

connecting with asp.net

Posted 2010-05-27 13:43
by viki singh
in the Oracle Forum
i am using asp.net to create a project and i need a connection string to connect it with an oracle server which is on a lan network.
i know its ip address and port no i will arrange if required.
i saw all the connection string for oracle but i got confused as to which one to chose.
please help.
thanks in advance.
Reply 2010-06-01 07:56
by Max Wikström
in the Oracle Forum
Try using the ones for the ".NET Framework Data Provider for Oracle" if youre using asp.net.
Reply 2010-06-01 11:39
by viki singh
in the Oracle Forum
please provide the whole connection string and values for the parameter also..
Reply 2010-06-01 11:53
by viki singh
in the Oracle Forum
thank you
i got the connection string but my problem is that the database is on a server.
i have the ip address and port number for it.
so where will i integrate these 2 parameters in the connection string??
Reply 2010-06-01 13:07
by Max Wikström
in the Oracle Forum
Hi
Either in tnsnames.ora or if you want you can use a string like this one...
Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID)));User Id=myUsername;Password=myPassword;

Change MyHost and MyPort with serveraddress and port.
Let me know if its working.
Reply 2010-06-01 13:40
by viki singh
in the Oracle Forum
thanks..
i will try it as soon as i can and will let you know..
Reply 2010-06-02 08:36
by viki singh
in the Oracle Forum
I tried all this options--

---------------------------------------------------------

Dim myConnection As New OleDbConnection("Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hostip)(PORT=1521))));Provider=msdaora;User Id=user;Password=pass;")

at first i didnt put the provider then it resulted into an error [An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB;]
so i placed th provider as msdaora and then it started showing a different error as["ORA-12154: TNS:could not resolve the connect identifier specified"]
---------------------------------------------------------

then i tried this---


Dim myConnection As New OleDbConnection("Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hostip)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID)));Provider=msdaora;User Id=user;Password=pass;")

and got this error [ORA-12514: TNS:listener does not currently know of service requested in connect descriptor].
---------------------------------------------------------
another option i tried was

---------------------------------------------------------
(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MyOracleSID)
Dim myConnection As New OleDbConnection("Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.5.12)(PORT=1521))((CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MyOracleSID);Provider=msdaora;User Id=trainee;Password=trainee;")
and got this--
ORA-12154: TNS:could not resolve the connect identifier specified


----------------------------------------------------
please provide me a solution..
Reply 2010-06-02 14:47
by Max Wikström
in the Oracle Forum
You are using the wrong provider.
Use this one with the connection string instead.
http://www.connectionstrings.com/Providers/net-framework-data-provider-for-oracle
Reply 2010-06-03 14:04
by viki singh
in the Oracle Forum
i did this today


Dim myConnection As OracleConnection = New OracleConnection()

myConnection.ConnectionString = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=myhost)(PORT=myport))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID)));User Id=user;Password=password;"

myConnection.Open()

MsgBox("reading")

myConnection.Close()


and got this error --
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

my guess is that the server does not understands this "MyOracleSID" cos server is the listner and the error msg says that it does not know of service requested in connect descriptor.
what could be wrong..

i tried one more thing..

Dim myConnection As OracleConnection = New OracleConnection()

myConnection.ConnectionString = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=host)(PORT=port))(CONNECT_DATA=(SID="db")));User Id=user;Password=pass;"

myConnection.Open()
MsgBox("reading")
myConnection.Close()


it is giving this error--

ORA-12505: TNS:listener does not currently know of SID given in connect descriptor

whats wrong?
plz tell me complete connection string and how to use it in asp.net
Reply 2010-06-03 17:17
by Max Wikström
in the Oracle Forum
Hi
The values in the string is just example values. You must alter these values to the ones for your server.
For instance you must change the "user" (user id) to a valid user name at your oracle server.
The values that you should change in the example is,
myhost
myport
MyOracleSID
user
password
Reply 2010-06-04 10:18
by viki singh
in the Oracle Forum
of cource i did changed those values i changed the ip to the one i have to use and changed the port to "1521" thats the one we r using here.
but still it didn work the same error comes up again and again

ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

plz find a way out of it..
Reply 2010-06-04 10:20
by viki singh
in the Oracle Forum
IS MYOracleSID the name of the database..??
i think i have tried that 2 but i think i will give it another go
Reply 2010-06-04 10:48
by Max Wikström
in the Oracle Forum
Yes, it means "System ID", but the SID is unique per database.
Reply 2010-07-29 13:38
by Lungisa Duna
in the Oracle Forum
viki,
did u manage to resolve your error: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

I have exactly the same problem and I have tried the options suggested in the previous responses.

Regards
Reply 2010-07-30 08:03
by Lungisa Duna
in the Oracle Forum
Viki,
I was finally able to get the connection thru
Data Source=IP:PORT/ServiceName.XXX

XXX is a reference within your serviceName for an example others use world

Hope this works out for you also.

Regards
Reply 2010-08-09 17:18
by viki singh
in the Oracle Forum
Lungisa Duna,
thanks... i will try that....
:)
Reply 2010-08-12 14:04
by ri jisong
in the Oracle Forum
Thank you, Lungisa Duna.
I have succeeded connecting oracle11g database in ASP.NET 4.0.
But I have only succeeded in my localhost.
Oracle 11g is installed in localhost.
After succeeding in localhost, I was tried to connect oracle 10g db in other machine.
just here, I failed to do.
I have installed oracle client 11g home2 in my localhost.
why can't I connect the oracle 10g db in other machine?
is the reason the oracle client 11g home2 in my local machine?
What about it?
I will look forward to your correct reply.
Regard . . .
Reply 2011-03-19 07:21
by tejas zinzuwadiya
in the Oracle Forum
I want to develope a software and in which i want to connect oracle data base with asp.net
can u please tell me how can i connect oracle database with asp.net.
Thanx in advance.
Reply 2011-03-19 07:26
by tejas zinzuwadiya
in the Oracle Forum
my front end is c# asp.net and backend is oracle 9i.
How can i able to connect this two??
please send me step by step solution.
thankyou!
Reply 2011-08-08 13:33
by Castor Troy
in the Oracle Forum
I went round and round trying to get a connections through VBScript. Im running the scripts on Win08 x64 servers running 11g and retrieving data from an old Oracle 8 database.
I finally succeeded using the following connection string -

"Driver={Oracle in OraClient11g_home2};Dbq=MyTNSName;Uid=MyUserID;Pwd=MyPassword;"

OraClient11g_home1 would have worked 2. I have 2 drivers listed from attempting to reinstall the 11g ODBC drivers.
Copyright © 2012 ConnectionStrings.com   |   All Rights Reserved   |   Powered by CSAS   |   Send feedback, articles, requests and more connection strings here.