I am trying to insert Date and Time in oracle using Date and Time Picker control (asp.net)
I have a field called HireDate. Now, for this field, I am trying to insert date using date picker control and able to insert successfully but with the same field, I would like to insert Date using Date picker control and Time using Time picker control. The result what, i am expecting is -- Eg: 01-JAN-2011 2:30 PM
What should I add to below code
Dim cn As New OracleConnection("Data Source=abc; User Id=ab;Password=ab")
Dim SQL As String
'build the INSERT statement
Dim xy As New System.Text.StringBuilder
Dim strDate As Date
Dim txtHireDate As String = strDate.ToString("dd-MMM-yy").ToUpper()
xy.Append(" INSERT INTO emp")
xy.Append(" (empno, ename, job, mgr, hiredate)")
xy.Append(" VALUES")
xy.Append(" ({0},'{1}','{2}',{3},'{4}')")
SQL = String.Format(xy.ToString, Me.txtEmpno.Text, Me.txtEname.Text, Me.txtJob.Text, Me.txtMgr.Text, DateTime.Parse(Me.txtHireDate.Text).ToString("dd-MMM-yy").ToUpper())
'create command object
Dim cmd As New OracleCommand(SQL, cn)
'open the connection
cmd.Connection.Open()
'execute the command
Dim result As Integer = cmd.ExecuteNonQuery()
'close the connection
cmd.Connection.Close()