Error: The best overloaded method match for string.ToString has some invalid arguments using C# in ASP.Net

Last Reply on Jan 09, 2017 04:31 AM By AnandM

Posted on Jan 06, 2017 01:52 AM

Dear programer,

I have a column named for Deposit_date and isert date from form side is as 01/01/2001

But i want to chnage this date as 01-Jan-2001

here is my code that is not working - 

SELECT * FROM Tabel replace(CONVERT(VARCHAR(15), Deposit_date, 106) AS [DD-MMM-YYYY])


Posted on Jan 09, 2017 04:31 AM

HI AnkitPal,

Refer below code

string b = "01/01/2001"; //Your value must be in sequence of month/date/year.
string a = Convert.ToDateTime(b).ToString("dd-MMM-yyyy");