Save date in ddMMyyyy format in MySQL Database in ASP.Net C#

Last Reply on Feb 15, 2014 12:50 AM By Azim

Posted on Feb 15, 2014 12:10 AM

i need to get some values from Mysql Db. i have passed some values to mysql and get the to pass date format in  MySql from C# code.

Posted on Feb 15, 2014 12:50 AM

You need create Varchar(20) Datatype for this

protected void Save(object sender, EventArgs e)
        DateTime dt = new DateTime();
        dt = Convert.ToDateTime(this.txtDate.Text);
        string date = dt.ToString("yyyy/MM/dd");        

Store the date in Varchar(20) Datatype column.