?
Solved

Connecting in Oracle DB with VB.NET

Posted on 2005-05-10
4
Medium Priority
?
7,514 Views
Last Modified: 2013-11-12
Hi, i have to connect in Oracle9i database and i tried every type of samples that this site have but doesn´t work yet.

Now i tried with a OracleClient connection:

Dim StrSql As String
        Dim MyConn As OracleConnection = New OracleConnection("User ID=USER;Password=PASS;Data Source=SERVERNAME")
       
           MyConn.Open()

            StrSql = "select * from DATABASE"

But when i Run the application, this is the error:
An unhandled exception of type 'System.EntryPointNotFoundException' occurred in system.data.oracleclient.dll
Additional information: Unable to find an entry point named OCIEnvCreate in DLL oci.dll

Could anyone help-me?

Sorry by my English, I´m a Brazilian and I´m learnig the language yet.
0
Comment
Question by:flavio2000
  • 2
4 Comments
 
LVL 4

Expert Comment

by:nachiket
ID: 13973225
As per the description the problem is not with connection or database.

U need a start point in your application. you should declare a public shared function. and make that a strat point.

Mean while is it a Windows forms or console application ?
==========================
The exception that is thrown when an attempt to load a class fails due to the absence of an entry method.

For a list of all members of this type, see EntryPointNotFoundException Members.

System.Object
   System.Exception
      System.SystemException
         System.TypeLoadException
            System.EntryPointNotFoundException

[Visual Basic]
<Serializable>
Public Class EntryPointNotFoundException
   Inherits TypeLoadException
[C#]
[Serializable]
public class EntryPointNotFoundException : TypeLoadException
[C++]
[Serializable]
public __gc class EntryPointNotFoundException : public
   TypeLoadException
[JScript]
public
   Serializable
class EntryPointNotFoundException extends TypeLoadException
Thread Safety
Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.

Remarks
Represents the error that occurs when an attempt to load an Assembly fails due to the absence of an entry point.

For a list of initial property values for an instance of EntryPointNotFoundException, see the EntryPointNotFoundException constructors.

Requirements
Namespace: System

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

Assembly: Mscorlib (in Mscorlib.dll)

See Also
EntryPointNotFoundException Members | System Namespace | Exception | Handling and Throwing Exceptions

0
 
LVL 4

Expert Comment

by:nachiket
ID: 13973246
1. Right click project ... select properties
2. Click on General from left tree view
3. From output type combo choose console application.
4. change the code something like this.

    Public Shared Sub Main()
        Dim StrSql As String
        Dim MyConn As OracleConnection = New OracleConnection("User ID=USER;Password=PASS;Data Source=SERVERNAME")

        MyConn.Open()

        StrSql = "select * from DATABASE"

    End Sub
0
 
LVL 9

Accepted Solution

by:
checoo earned 1000 total points
ID: 13974809
the problem in this specific case is that the runtime is not able to load the oci.dll, what it means is that the oracle home path is not configured properly in the PATH environment variable.

Ensure that the path to the bin folder of the local oracle client installation (i.e. the installation on the machine from which the application is being executed) is added to the front of the PATH environment variable.
0
 

Author Comment

by:flavio2000
ID: 14013958
I had to install de Oracle9i client in my computer, after that, i had to configure the tnsnames.ora. Now it´s working!

tks.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Software development teams often use in-memory caches to improve performance. They want to speed up access to, or reduce load on, a backing store (database, file system, etc.) by keeping some or all of the data in memory.   You should implement a…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question