Hi,
To delete a record, the SQL query is
DELETE FROM <TableName> where ID = 'IDno'
Follow the steps:
### Importing the Namespaces
Imports System
Imports Oracle.DataAccess.Client
###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")
myOracleConnection.Open()
###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 = _
myOracleConnection.BeginTransaction()
###Step3 The third step is to create an OracleCommand object to store a SQL statement.
Dim myOracleCommand As OracleCommand =
myOracleConnection.CreateCommand
###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 & "'"
Step 5
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
myOracleCommand.ExecuteNonQuery()
MessageBox.Show("Record Deleted successfully!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
Step 6
The eighth step is to commit the transaction in the database using the Commit() method of the OracleTransaction object.
In
VB.NET:
myOracleTransaction.Commit()
Step 7
The ninth step is to close the OracleConnection object using the Close() method.
myOracleConnection.Close()
MORE REFERENCE
-------------------------------
Try the following links
http://www.startvbdotnet.com/ado/oracle.aspx
http://answers.yahoo.com/question/index?qid=20080523192932AAiqSld
regards
Sarwan