Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old June 23rd, 2008, 02:12 AM
Authorized User
 
Join Date: May 2007
Location: Hyderabad, Andhra Pradesh, India.
Posts: 95
Thanks: 5
Thanked 0 Times in 0 Posts
Default Date format problem

Hi all

In my web application(developing using C#, ASP.NET 2.0), i m showing date to the user for last 7 days starting from today's date in the form Monday, June 23, 2008.
code is:
string strDdlDate;

for (int intDay = 7; intDay > 1; intDay--)
        {
            //strPass = DateTime.Now.ToString();
            strDdlDate = DateTime.Now.AddDays(intDay-7).ToLongDateString();
            ddlDate.Items.Insert(0, new ListItem(strDdlDate, strDdlDate));
        }
        ddlDate.SelectedValue = DateTime.Now.ToLongDateString();


I am loading all these dates in the dropdown. Now the problem is that if the user selects any date it will be in the form as i have mentioned above. How can i convert the selected date into MM/DD/YYYY format, so that i can pass it to Database.


-- Abhishek

Reply With Quote
  #2 (permalink)  
Old June 23rd, 2008, 02:25 AM
Authorized User
 
Join Date: May 2007
Location: Hyderabad, Andhra Pradesh, India.
Posts: 95
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Hi all

i solved the problem by using Convert.ToDateTime :)

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Format Problem cyberddindia Classic ASP Basics 2 October 23rd, 2006 01:49 AM
Date Format Problem Scripts82 Access VBA 2 March 13th, 2006 08:36 PM
Date format problem ERC Crystal Reports 1 June 15th, 2005 04:03 AM
Date format problem widad Classic ASP Basics 1 October 15th, 2004 06:31 PM
Date Format problem in Oracle ppenn Oracle ASP 1 May 10th, 2004 06:00 PM



All times are GMT -4. The time now is 04:02 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.