Click here to Skip to main content
15,900,511 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a telerik date picker its display date fromat is MMM-yyyy but when its saving date its saving date in this format 7/6/2013 12:00:00 AM

but in my database i want to enter date in this format MMM-yyyy

i am doing this
C#
Dim s1 As String = [String].Format("{MMM-yyyy}", RadDatePicker1.SelectedDate.Value.ToString("dd/mm/yyyy"))



i am getting following error (Input string was not in a correct format.)
Posted

Your input string not in correct format.

try this---

Dim s1 As String = [String].Format("{MM-yyyy}", RadDatePicker1.SelectedDate.Value.ToString("dd/MM/yyyy"))
 
Share this answer
 
try this:-
Dim strDate As String = Format(CDate(RadDatePicker1.SelectedDate.Value.ToString()), "MM-dd-yyyy")
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900