How to store Form values in Oracle 10g with VB.NET

255 pts.
Tags:
Database programming
Oracle 10g
VB.NET 2005
Visual Basic .NET
abt database storage in vb.net2005

Answer Wiki

Thanks. We'll let you know when a new response is added.

Have a look at the following Oracle article for the basics on connecting to the database from .NET

It shows how to connect to the database and retrieve records using SELECT statements. To perform inserts and updates you just need to change de command text with the appropriate SQL command, and execute it as non reader (i.e. replacing cmd.ExecuteReader with cmd.ExecuteNonReader).

<a href=”http://www.oracle.com/technology/pub/articles/cook-vs08.html”>Build a .NET Application on the Oracle Database with Visual Studio 2005 or 2008</a>

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Shaz
    Thanks Carlosdl for giving me the answer ,i will work out with this
    255 pointsBadges:
    report
  • Shaz
    Imports Oracle.DataAccess.Client Dim oradb As String = "Data Source=localhost;User Id=shazia;Password=shazia;" Dim oradb As String = "Data Source=(DESCRIPTION=" _ + "(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))" _ + "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ORCL)));" _ + "User Id=shazia;Password=shazia;" Dim conn As New OracleConnection(oradb) Dim conn As New OracleConnection() ' Visual Basic conn.ConnectionString = oradb conn.Open() MsgBox("connected successfully") iam getting errors such as Error 1 Statement is not valid in a namespace. C:Documents and SettingsShazia (Delonti)My DocumentsVisual Studio 2005ProjectsschoolschoolAdd Admission.vb 4 1 school plz give me a solution for this .iam new vb.net Thanks once again
    255 pointsBadges:
    report
  • carlosdl
    In .NET, everything have to be inside a class or module (excluding the imports). Also, there are some unnecessary lines in your code, for example the lines where you set the connection string. If you want to avoid the use of the TNSNAMES.ORA file then use your second option: Dim oradb As String = “Data Source=(DESCRIPTION=" _ + “(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))” _ + “(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ORCL)));” _ + “User Id=shazia;Password=shazia;” Otherwise, use this (but replace 'localhost' with the database alias defined in your tnsnames.ora file): Dim oradb As String = “Data Source=your_database_alias;User Id=shazia;Password=shazia;” Your code should look similar to this: Imports Oracle.DataAccess.Client Public Class MainClass Shared Sub Main() Dim oradb As String = “Data Source=(DESCRIPTION=" _ + “(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))” _ + “(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ORCL)));” _ + “User Id=shazia;Password=shazia;” Dim conn As New OracleConnection(oradb) conn.Open() End Sub End Class
    69,045 pointsBadges:
    report
  • Shaz
    Hi Carlosdl, Thank u for helping me out .I have implemented the code which u have given .Now it is giving as error connection not open ora 6413.Plz give solution for that Thanks & Regards, shazia.
    255 pointsBadges:
    report
  • carlosdl
    I posted an answer here: Solution for ORA-6413 error showing connection not open See if it helps.
    69,045 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following