PLEASE HELP ME. THIS CODE WILL RETRIEVE THE SEQUENCE YOU MADE. AND WILL OUTPUT IN THE TEXBOX IN THE NEXT FORM. BUT MY PROBLEM IS THAT IT DOES NOT RETRIEVE/GIVE THE GENERATED SEQUENCE. FOR SHORT NO OUTPUT T__T . PLEASE HELP.
Public Sub getJO()
Dim oradb As String = "Provider=OraOLEDB.Oracle; Data Source=TRAVELMATE-PC/XE;User Id=cj;Password=me;"
Dim cn As New OleDbConnection
Dim cm As New OleDbCommand
Try
cn.ConnectionString = ConfigurationManager.ConnectionStrings("mysys.My.MySettings.ConnectionString").ConnectionString()
Dim conn As New OleDb.OleDbConnection(oradb)
cn.Open()
cm.Connection = cn
cm.CommandText = "select ID_SEQ.currval from dual"
cm.CommandType = CommandType.Text
Dim dr As OleDbDataReader = cm.ExecuteReader()
If dr.Read() Then
Form4.TextBox1.Text = dr.Item(0).ToString
End If
Catch ex As Exception
End Try
cn.Close()
End Sub