Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DateTimePicker.Text in oracle using c#

727762Mar 1 2011
Hi Experts,
Please I need your help because I am developing a tool that will take a value from DateTimePicker.Text and update an oracle database date; however I am getting the following error(ORA-00932: inconsistent datatypes: expected DATE got NUMBER), and I google the error message if I can get some kind of idea on what to do but no luck and I try convert to date-no luck. Please help! Below is my code using c#

private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
{
label9.Text = dateTimePicker1.Text;
}


private void conn3(string oradb3)
{

OracleConnection conn = new OracleConnection(oradb3);

conn.Open();

//Create an OracleCommand object using the connection object
OracleCommand cmd = new OracleCommand("", conn);

// Start a transaction
OracleTransaction txn = conn.BeginTransaction(IsolationLevel.ReadCommitted);

cmd.CommandText = "update logical_date set logical_date= " + label9.Text + " where expiration_date is null";

{
cmd.CommandType = CommandType.Text;
cmd.ExecuteNonQuery();
txn.Commit();

}
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 29 2011
Added on Mar 1 2011
0 comments
744 views