hello every1
actually m new to vb.net,
i have installed oracle 9i on my system and i dont knw how to connect even a simple form to my sql table in which i have two fields named first_name and last_name, the name of the table in sql is user.
can some1 please tell me how to connect my form1 with the my sql table so that when i type the names in two text boxes the data is stored in the database.........
ALSO HOW TO CONFIGURE THE DATABASE I.E
CONTROL PANEL-->ADMINISTRATIVE TOOLS-->ADD CONNECTION......
IS THERE ANY NEED OF DOING IT.......
THANX IN ADVANCE....

First of all if you want to make a connection between VB.net and a database using oracle you have to to the following

Imports System.Data.Odbc

at the top of the form code file.

then add 2 variables for the ODBC connection and command

dim Mycon As New odbcConnection
    dim Mycmd As New odbcCommand

Next what I prefer is making a new procedure containing the connection string and the connection between the command object and the connection.

Sub OpenConnection()
        Mycon.ConnectionString = "data source= ;initial catalog=;user id=;password="
        Mycon.Open()
        Mycmd.Connection = Mycon
    End Sub

then in the FormLoad event, add OpenConnection()

Now you've successfully connected to the database, do a research on how to execute queries using textboxes, buttons, etc...

Sounds like a noob but I'm still a beginner too.

Member Avatar for Unhnd_Exception

Why do you add the Imports System.Data.Odbc at the top of the form code file. Just curious. I'm a bit of a noob too.

Is there any need to add data sources from the toolbox as well?

DANTHEVAM, It is giving an error on mycon.open,
it says:An unhandled exception of type 'System.Data.Odbc.OdbcException' occurred in system.data.dll

Additional information: System error.

Why do you add the Imports System.Data.Odbc at the top of the form code file. Just curious. I'm a bit of a noob too.

just because when he declares the variables, he doesn't have to call it dim mycon as new system.data.odbc.odbcconnection.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.