Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi friends ,
i have table in oracle 10g.in which there are a column with date datatype.
I insert value in that table using stored procedure.i am using following code..

C#
           OleDbDataAdapter adp = new OleDbDataAdapter("ins_emp",con);
           DataSet ds = new DataSet();
           adp.SelectCommand.CommandType = CommandType.StoredProcedure;
adp.SelectCommand.Parameters.AddWithValue("@psdate", "(to_date('"+Label1.Text+ "','mm/dd/yyyy'))");

           adp.Fill(ds)

but i get the follwing error..

ORA-01858: a non-numeric character was found where a numeric was expected
or how save date from .net in oracle.
Help me on this topic.Its urgent...
Thanks in advance.
Randeep Chauhan
Posted
Updated 4-Nov-11 19:45pm
v2

1 solution

Use the following :
C#
adp.SelectCommand.Parameters.AddWithValue("@psdate", DateTime.Parse(Label1.Text);
 
Share this answer
 
Comments
Randeep Chauhan 5-Nov-11 1:57am    
Thank you very much Mehndi Sir,I need it.
Thank again and again.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900