AspdotnetCodes.com
Search
Articles
Books
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
Questions & Answers
Tips & Tricks
 Date Format Issue
Posted by RAJESH KUMAR VISHWAKARMA on  11/18/2009 3:01:47 AM Category: ADO.NET
Add to my favorites
Email to friend
I am tring to store Date in this fromat 10/26/2009 in sql2000 through DateTime Picker in asp.net.
When i pick up date from DateTime Picker, 10/26/2009 date format is coming in TextBox.

But in database 2009-10-26 Format is coming. i know Sql server doesn't support dd/mm/yyyy.

For Storing i am writing following syntax
Convert.ToDateTime(DatePicker1.txtDate.Text.ToString()).ToString("YYYY/MM/DD")

I need to store in this format 10/26/2009 (MM/DD/YYYY) in database

Could You plz Help Me?

Thank you!
Regards
R.k.vishwa



Post Your Reply Post New Question

 Viewer's Reply
Specify Collations in SQL Table Creation
Answered By Moderator1 on 11/19/2009 7:01:00 AM
Hi,

By default, as you knew, SQL Server will store dates in yyyy/MM/dd format. Anyhow, try to change the collation setting of the database, or while creating the table try to find the correct collation name for storing the date in your format. But I'm not sure on this.

Btw, may I know why you want to store the date in dd/MM/yyyy format. Is it making problem while displaying it, if so, you can format it. Please post in this thread, if you have any further questions regarding the DateTime format.

Thanks.
 
Post Your Reply If you still have problem, post it again under this reply for better response.

 
Sponsored by
Everything You Know About CSS Is Wrong! - Free 37 Page Preview!
Building a Web Application Security Program
The PHP Anthology: 101 Essential Tips, Tricks & Hacks, 2nd Edition - Free 207 Page Preview!