Link to home
Start Free TrialLog in
Avatar of flavio2000
flavio2000Flag for Brazil

asked on

Connecting in Oracle DB with VB.NET

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.
Avatar of nachiket
nachiket

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

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
ASKER CERTIFIED SOLUTION
Avatar of checoo
checoo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of flavio2000

ASKER

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

tks.