Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> VB.Net connection to Oracle 10G database

VB.Net connection to Oracle 10G database

From: Dave Baker <newsgroup_poster_at_jodael.com>
Date: Tue, 21 Mar 2006 15:22:51 +0800
Message-ID: <ml9v125brja3ddg2gk640mega6dlgj6dks@4ax.com>


First things first - I'm very new at Oracle!

I have installed Oracle 10G XE on an XP Pro computer & have created 3 blank tables using the web GUI interface from Oracle. All fine so far. My next step is to fill the tables with data via VB.Net.

I am using the example at:
http://www.oracle.com/technology/pub/articles/cook_dotnet.html to connect to my table.

At the moment my VB.Net application is running on the same computer as Oracle, though the next step will be to have the application running on a different machine. Small steps first.

Also, my aim was to bypass the tsnames.ora through the use of a full connection string as per the example - seems easier at the moment.

So, I have this VB.Net code:

  Dim oradb As String = "Data Source=(DESCRIPTION=" _
+ "(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))" _
+ "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=Vessel_Data)));" _
   + "User Id=SYSTEM;Password=opswd;"

   Dim conn As New Oracle.DataAccess.Client.OracleConnection(oradb) ' VB.NET

   Debug.WriteLine(oradb)
   conn.ConnectionString = oradb

   conn.Open()

Running it gets to the conn.Open() line where it stops with error:

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

I believe my username & password are correct, but am completely unsure about what should go into the 'SERVICE_NAME=' field. I've been reading all day including places saying SERVICE_NAME is the same as SID and done some SQL to get the SID but all I get is a number (28) which doesn't work either.

Can anyone let me know exactly what should go in this field (or where I can find it)? Or possibly the error is actually telling me of a problem elsewhere in the string?

Thanks,

Dave Received on Tue Mar 21 2006 - 01:22:51 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US