473,748 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accessing an Oracle database with vb.net

I'm trying to access an Oracle database vb.net. I found several examples.
I tried following each one, but I get the same error no matter what I try.
I don't really understand what the error means (I've never tried accessing
an Oracle database before). The error I get is:

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

I installed the oracle dll and added it as reference (I get the same error
if I use the Oracle reference that came with VS2003.) I figure it's hitting
the database ok since if I change the name of the database it's connecting
to, I get an error that it couldn't resove the name. Here's the code I'm
using, pretty much straight from the example on Oracle's web site:

Dim con As OracleConnectio n = New OracleConnectio n

con.ConnectionS tring = "User ID=scott;Passwo rd=tiger;Data Source=oracledb ;"

Try

con.Open()

Catch ex As Exception

tmp = ex.Message

End Try

Naturally, I'm using different user id, password and db name in my actual
code. The program errors on the con.Open() line.

Any ideas on where to look would be greatly appreciated.

Mark


Feb 26 '07 #1
2 4081
In article <e#************ **@TK2MSFTNGP03 .phx.gbl>, mb****@echd.no-
spam.org says...
I'm trying to access an Oracle database vb.net. I found several examples.
I tried following each one, but I get the same error no matter what I try.
I don't really understand what the error means (I've never tried accessing
an Oracle database before). The error I get is:

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

I installed the oracle dll and added it as reference (I get the same error
if I use the Oracle reference that came with VS2003.) I figure it's hitting
the database ok since if I change the name of the database it's connecting
to, I get an error that it couldn't resove the name.
It's been a few years since I had to deal with Oracle, but I'll give it
a shot.

First, when you say you "installed the oracle dll", does that mean you
actually installed the oracle client? If not, I would install the
oracle client and include SQL plus during the installation. SQL Plus is
a kind of isql/w (if you're familiar with SQL Server).

Once the client is installed, make sure you tnsnames.ora file is
configured correctly. This, I can't help you with since I don't
remember what is necessary, but I do recall that was a source for
frequent frustration.

Third, make sure the Oracle listener service is running on the oracle
server.

Good luck!

--
Patrick Steele
http://weblogs.asp.net/psteele
Feb 27 '07 #2
"Patrick Steele" <pa*****@mvps.o rgwrote in message
news:MP******** *************** *@msnews.micros oft.com...
In article <e#************ **@TK2MSFTNGP03 .phx.gbl>, mb****@echd.no-
spam.org says...
>I'm trying to access an Oracle database vb.net. I found several
examples.
I tried following each one, but I get the same error no matter what I
try.
I don't really understand what the error means (I've never tried
accessing
an Oracle database before). The error I get is:

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

I installed the oracle dll and added it as reference (I get the same
error
if I use the Oracle reference that came with VS2003.) I figure it's
hitting
the database ok since if I change the name of the database it's
connecting
to, I get an error that it couldn't resove the name.

It's been a few years since I had to deal with Oracle, but I'll give it
a shot.

First, when you say you "installed the oracle dll", does that mean you
actually installed the oracle client? If not, I would install the
oracle client and include SQL plus during the installation. SQL Plus is
a kind of isql/w (if you're familiar with SQL Server).

Once the client is installed, make sure you tnsnames.ora file is
configured correctly. This, I can't help you with since I don't
remember what is necessary, but I do recall that was a source for
frequent frustration.

Third, make sure the Oracle listener service is running on the oracle
server.

Good luck!
Thanks for the reply. I do have the client installed and I can access the
database using Query Builder. But in my application, when it tries to
connect, I get that error, which from what I've been able to find out means
that I contacted the server, but not registered with the listener. But no
one ever seems to mention how to do that.

Mark
Feb 27 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2357
by: Dan Ellis | last post by:
Hi, I've been down so many dead ends trying to get something working, so I'm really hoping someone can help out. I need to access an Oracle database running on a Windows server from Python running on Linux. I've tried building DCOracle2, but it seems that the 'oracle-installclient-basic' thing I downloaded from the Oracle site doesn't contain enough. I've tried various other approaches, such as mxODBC/iODBC, but without much luck. I'm...
1
16148
by: majk | last post by:
hey! Im looking for a db tutoral which covers accessing a Microsoft SQL database on windows. I will be using VC++ if it matters. NO details just a basic introduction! Oracle DB access using C++ is also of interest! Thanks!
4
1903
by: dougjrs | last post by:
Good Afternoon, I have a Java stored procedure on DB2 z/OS and it is using the Type 4 JDBC driver to access an Oracle database. After I get the data from the Oracle dataabse I try to return it from my SP as a result set, but I get an -20213 because the result is from Oracle and not DB2. Can you convert from an Oracle resultset to a DB2 resultset (and how)? Thanks,
10
3534
by: Andrea M. Segovia | last post by:
Hello, I am a newbie to Oracle databases.... We have a visualization front-end tool connected to an Oracle back-end database on a Tru64 UNIX server. We also have clients with MS access databases who would like to share their data using this visualization tool but do not want to import their data into the Oracle server back-end.
6
4342
by: Jeff | last post by:
Has anyone had any luck accessing an Oracle database from a web service? I have a C# DLL with various code to query an Oracle database. If I call the methods in this DLL from a Windows Forms application everything works just fine. However, if I call the methods in this DLL from a web service, I receive the following error when the database connection is opened: Error: ORA-12154: TNS:could not resolve service name Does anyone know...
1
1609
by: Dave | last post by:
Hi All I'm having a problem connecting to an Oracle database using C# I have a service name : "SN I have a user id :"UID I have a password : "PWD" I can find snippets of code on the web but am confused as to what refernces to match up with what connection strings I would like to use an Oracle not a Microsoft provider
3
2690
by: Pakna | last post by:
Hello, I have what may be a beginner's question regarding DB2. How does one access a remote table on a remote database via SQL? What is the command string, is there an equivalent of Oracle DBLINK? I hope I was clear. If there are more information that I need to supply, please do tell me. Thank you very much for your replies
8
14312
by: =?Utf-8?B?RGF2aWQrKw==?= | last post by:
Hi, I have been developing Web Services in VS2005. Usually I use the built in server in VS2005 to test and develop the Web Service. However I now want to make this Web Service available to other computers (and applications) in our local company network. When the service runs it accesses an Oracle database and pulls some data out. It works fine when running in VS2005 server. To allow the Web Service to
2
1307
by: Ken Williams | last post by:
WhenI search Internet there thousands of comments and samples for database conenction and tuning. They are all advanced and comprehesive. I didn't found a simple "Hello World" for accessing an Oracle database. This sample should contain just - connecting to database, - pass an SELECT FROM WHERE statement and - read the result into a CSharp internal table/records.
0
8996
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9562
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9386
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9333
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3319
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.