Click here to Skip to main content
15,034,986 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi All..,
I want to send Date to sqlserver,i am using datetimepicker control in my application,i need to send through string format
CString str;
str.Format(_T("insert into db values(\'%s\')",m_date));

how can i acheive it...
Legor 13-Jun-12 7:54am
Oh no you have a Query in your project?? How could that happen?
Tim Corey 13-Jun-12 8:27am
It is unclear what you are asking us to help with. Are you unsure of how to write an INSERT statement? Are you unsure of how to run that on the SQL server (or whatever database server you are using)? Are you unsure how to get the data to upload? Right now we don't know how to help you.
Richard MacCutchan 13-Jun-12 8:59am
Don't use strings to store dates in SQL; use the datetime or similar type.

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