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
Take only date from datatimepicker
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Pravin MoreRank #1,419 · 1.2K reputationPosted Nov 22, 2011, 2:12 AM EST
try this code..
radDateTimePicker.Culture = new System.Globalization.CultureInfo("en-US")
{
DateTimeFormat = new System.Globalization.DateTimeFormatInfo
{
ShortDatePattern = "dd"
}
};
Thanks,
Pravin.
Datta KharadRank #2,135 · 668 reputationPosted Nov 22, 2011, 3:00 AM EST
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();