Connecting in Oracle DB with VB.NET

Posted on 2005-05-10
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")

            StrSql = "select * from DATABASE"

But when i Run the application, this is the error:
An unhandled exception of type 'System.EntryPointNotFoundException' occurred in
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.
Question by:flavio2000
    LVL 4

    Expert Comment

    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.


    [Visual Basic]
    Public Class EntryPointNotFoundException
       Inherits TypeLoadException
    public class EntryPointNotFoundException : TypeLoadException
    public __gc class EntryPointNotFoundException : public
    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.

    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.

    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

    LVL 4

    Expert Comment

    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")


            StrSql = "select * from DATABASE"

        End Sub
    LVL 9

    Accepted Solution

    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.

    Author Comment

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


    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    What is Waterfall Model? Waterfall model is the classic Software Development Life Cycle method practiced in software development process. As the name "waterfall" describes, this development is flowing downwards steadily like waterfall, i.e., procee…
    Dependencies in Software Design In software development, the idea of dependencies ( is an issue of some importance. This article seeks to explain what dependencies are and where they …
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    755 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

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now