Hi,
How to set datetimepicker to only date and insert into database. I want only date to be inserted into database that is selected from datetimepicker.
thanks, waiting for the reply,
thanks
prasanna
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Datta KharadPosted Nov 22, 2011, 8:00 AM
string dts = dateTimePicker1.Text ;
//Example:- Sore record into oracle database
cmd.CommandText = "insert into empdbimg(eid,ename,hiredate)values(:eid,:ename,:hiredate,)";
cmd.Parameters.Add (":eid",txteid .Text );
cmd.Parameters.Add (":ename",txtename .Text );
cmd.Parameters.Add (":hiredate",dateTimePicker1.Text );
cmd.Connection = con;
cmd.ExecuteNonQuery();
Pravin MorePosted Nov 22, 2011, 7:12 AM
try this code..
radDateTimePicker.Culture = new System.Globalization.CultureInfo("en-US")
{
DateTimeFormat = new System.Globalization.DateTimeFormatInfo
{
ShortDatePattern = "dd"
}
};
Thanks,
Pravin.