I have this sub in my asp.net page.
Sub CommitTimeReported(myid as label, myprojectid as label, myhours as
textbox)
Dim DS As DataSet
Dim MyCommand As OLEDBCommand
Message.InnerHtml &= myid.text & " " & myprojectid.text & "<BR>"
Dim ConnStr as string ="Provider=OraOLEDB.Oracle.1;User
id=tsadmin;Password=sept24;Data Source=wrc"
Dim MyConnection as New OLEDBConnection(ConnStr)
Dim InsertCmd As String = "insert into emprojects(empid, projid)
values (@empid, @projid)"
MyCommand = New OLEDBCommand(InsertCmd, MyConnection)
MyCommand.Parameters.Add(New OLEDBParameter("@empid",
OLEDbType.integer, 5))
MyCommand.Parameters("@empid").Value = myid.text
MyCommand.Parameters.Add(New OLEDBParameter("@projid",
OLEDbType.VarChar, 14))
MyCommand.Parameters("@projid").Value = myprojectid.text
message.InnerHtml &= "Projid value " &
MyCommand.Parameters("@projid").Value & "<BR>"
MyCommand.Connection.Open()
Try
MyCommand.ExecuteNonQuery()
Message.InnerHtml = "<b>Record Added</b><br>" &
InsertCmd.ToString()
Catch Exp As SQLException
If Exp.Number = 2627
Message.InnerHtml = "ERROR: A record already exists with the
same primary key"
Else
Message.InnerHtml = "ERROR: Could not add record, please
ensure the fields are correctly filled out"
End If
Message.Style("color") = "red"
End Try
MyCommand.Connection.Close()
End sub
when I run it, i got the follow error:
ORA-00936: missing expression
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: ORA-00936: missing
expression
any suggestion?
thanks