Click here to Skip to main content
15,900,973 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
1989'-'06'-'30
C#
string date = "'" + ddlyear.SelectedItem.Text.ToString().PadLeft(2, '0') + "'-''" + ddlmonth.SelectedItem.Text.ToString().PadLeft(2, '0') + "'-'" + ddlday.SelectedItem.Text.ToString().PadLeft(2, '0') + "'";

but i want the o/p as follows
C#
1989-06-30
Posted
Updated 10-Oct-13 0:03am
v3
Comments
Thanks7872 10-Oct-13 6:48am    
You have been given answer for each and every question,but you have not accepted any of the answer in any question. You are expected to accept the solutions which work for you.

Hi...
Once use
XML
<asp:CalendarExtender></asp:CalendarExtender>

Ajax control.
 
Share this answer
 
Try this single line of code
C#
string date="1989'-'06'-'30";
string final=date.Replace("'","");

Regards...
 
Share this answer
 
Try This
C#
string s = DropDownList1.SelectedItem.Text;
        DateTime d =Convert.ToDateTime(s);
        string f = d.ToString("yyyy-MM-dd")
 
Share this answer
 
v2

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