pass Convert.ToDateTime to date in MysqlDataType RRS feed

  • Question

  • Hi,

    I have a DevExpress DatePicker component in my C# windows for application which will display a DateTime and I have a timestamp or datetime field in MySQL.

    I want to use the date only from the datePicker and find it by date only in the MySQL regardless of the time.
    Wednesday, March 6, 2013 1:21 PM


  • To find a date in MySQL you need a string so all you havve to do is to convert a dattetime to a string in the format of the date string in MySQL.

                DateTime date = DateTime.Now;
                string dateStr = date.ToString("MM/dd/yyyy");


    Wednesday, March 6, 2013 1:49 PM