Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
To respected sir/madam

pl. help me to get date from calendar control selected date to text box in dd/mm/yyyy format & insert into sql server 2005

Thanking you,
Sanadi M.H.
Posted
Updated 27-May-13 2:21am
v2
Comments
Varun Sareen 27-May-13 8:18am    
what have you tried so far??
[no name] 27-May-13 8:22am    
And what kind of help do you need?

display date in textbox in dd-mm-yyyy format
C#
Textbox1.Text = CalendarControl1.Value.ToString("dd/MM/yyyy");

when inserting in database format should be yyyy/MM/dd
so, if not using storeprocedure then
C#
"Insert into .... values(...,'" + CalendarControl1.Value.ToString("yyyy/MM/dd") + "',...)"


if inserting using sp then
C#
Parameters.AddWithValue("@date1", CalendarControl1.Value, SqlType.DateTime)

Happy Coding!
:)
 
Share this answer
 
gfhgfhgfh
JavaScript

 
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