using the calender control ..i am getting the date in a textbox...and i have to insert this into database ..using asp.net with c#
in the table also field is date..
how can i do this..i did like this .but it is not inserting
I am facing the same dilemma... Save feature in my application in C# is build by the visual studio tool. So I am not writing any code for saving as its done automatically by the generated code. Now I have a datetime picker on my form which is binded to a date field in MS Access at the backend. Now I just want to save the date and not the time. This is causing me trouble as its saving the time also. How should I save just the date and not time.
Any advise, suggestion will be highly appreciated.
Well I was able to solve this issue in another way... I had to use the date from the Database to compare it to some present date. Well I modified the query to just get the date from the database rather than the whole date & time. So this solved my problem but its still saving the time in the Database.
The above solution will definitely give only the date part but that will be in string format. I want to compare this date with an Excel date and comparing a string with an Excel date doesnot work. Can you please suggest me some other workaround to this problem.
All of these methods seem to return string. What is the correct way to return Date portion only (and set time to 0) of the DateTime value?
Although I think I will pass the date as is to T-SQL procedure and remove time portion there.
Thanks in advance.
BTW, can someone please move this thread to Visual C# forum as it's more like a language question?
For every expert, there is an equal and opposite expert. - Becker's Law
- Edited by Naomi N Wednesday, February 13, 2013 4:07 PM