Win Surprise Gifts!!!
Top 5 Contributors of the Month
Post New Question
Subscribe to Forum
Oracle Database connection Program in Vb.Net
February 09, 2010
I want sample ADD,UPDATE,DELETE,SEARCH Record Program in Vb.Net with
BackEnd -Oracle 10g
what is the Server name for Oracle Coonection Strig?
Plz Help Me.
Posted Date: February 09, 2010 Points: 5
Follow the steps:
Importing the Namespaces
###Step 1 The first step is to create an OracleConnection object to connect to the Oracle database and then open the connection.
Dim myOracleConnection As New OracleConnection( _
"User Id=store;Password=store;Data Source=ORCL")
##Step2 The second step is to create an OracleTransaction object and start the transaction by calling the BeginTransaction() method of the OracleConnection object.
Dim myOracleTransaction As OracleTransaction = _
###Step3 The third step is to create an OracleCommand object to store a SQL statement.
Dim myOracleCommand As OracleCommand =
###Step 4 The fourth step is to set the CommandText property of the OracleCommand object to the DELETE statement that deletes a row from the table.
myOracleCommand.CommandText = _
"delete from table where id = ' " & txtID.txt & "'"
The fifth step is to run the DELETE statement using the ExecuteNonQuery() method of the OracleCommand object.
Dim Delete = MessageBox.Show("Are You Sure to Delete", "Query", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If (Delete = vbYes) Then
MessageBox.Show("Record Deleted successfully!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information)
The eighth step is to commit the transaction in the database using the Commit() method of the OracleTransaction object.
The ninth step is to close the OracleConnection object using the Close() method.
To post reply
Related Questions Related Questions
Create new Database connection error
Visual Basic 6.0 Program to Check Log in Details with Access Database
How to use database connection which is used in appsettings(webconfig) in the code behind?
ASP.NET - Working with Oracle 9i Database / Database Stored Procedures
I have problem regarding creating connection to database
How to implement oracle database with sql server?
oracle connection problem urgent
database connection in WPF
hai can any one provide me a small c# program with sql connection
Website fails database connection in IIS 5.1 but works well in Development Same computer
Latest Forum Questions From The Same Category
Window Service C#.net not working properly
C# Onvif IP Camera Viewer NuGet package
Land Registry Business Gateway Webservice - reference the returned XMLDocument
Technology to be used for Finance Application
problem instal net framwork 4
I am looking for Dotnet developer opening in Middle level company.
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more
Quick Links For Forum Categories:
Hall of Fame
Terms of Service
Tell A Friend