Hi All,
I have many DateTimePicker (DTP) in a windows form (Say atleast 15 DTP)
I need to do following things in the form
1)A Dataset is field with values from database (MS SQL) which contains the DateTime data and now i want to assign it to DTP and Doing as Follows
if (Ds.Tables[0].rows[0]["FieldDateTime"].Tostring()!=null)
{
DTP.text=Convert.ToDateTime(Ds.Tables[0].rows[0]["FieldDateTime"].Tostring()).ToshortDateTIme()
}
else
{
DTP.Text="";
}
Here in Else Condition DTP.text get the Todays by Default which i dont want to do this
2) I tried with doing
DTP.CustomFormat=" ";
DTP.Format=System.Windows.Forms.DateTimepickerForamt.Custom;
The DTP Text Gets Blank , but again if i want to select(Modify) the DTP values again the DTP control does not select the required date.
Could you pls provide me the solution if any.
THank you