Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4595350
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:57:28+00:00 2026-05-21T22:57:28+00:00

I have a page where I CREATE and UPDATE an event and this event

  • 0

I have a page where I CREATE and UPDATE an event and this event can have eventDate input calendar:

When creating an event all works great. When I update an event I pre-populate this field with the date from DB:

txtEventDate.Text = Reader.GetDateTime(7).Date.ToShortDateString();

Now, it shows nice:

05/05/2011

but the same code which worked for CREATING an event, now fails on UPDATING here:

cmd.Parameters.Add("?eventDate", MySqlDbType.DateTime).Value = DateTime.ParseExact(txtEventDate.Text + " " + txtEventTime.Text,
                    "MM/dd/yyyy HH:mm", CultureInfo.InvariantCulture);

because it ‘sees’ (checked with Debug) that txtEventDate.Text has value:

5/5/2011

So the 0’s are missing…

It’s just really ugly…because in UI they are there…Do you know what can be the problem?

UPDATE: I’ve attached the photo to prove the issue…enter image description here

Ps: When I do not EDIT the event (so I do not pre-populate this field but choose choose some date from calendar) all works perfectly…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T22:57:29+00:00Added an answer on May 21, 2026 at 10:57 pm

    First of all, for date part of a format you should specify "mm/dd/yyyy" (with non-capital “M” letters) to ignore the leading zeroes while parsing but my concern is that the error you posted in the image does not include time and you used DateTime.ParseExact() function with time format included.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to create a web page that for the purposes of this question
I have few question in this regard When you create an internet page, does
I have got this event in my page aspx.cs: public void deleteBtn_Click(object sender, CommandEventArgs
I have my views render to route requests like /controller/action (for instance, /Page/Create), so
I have a page which basically allows an admin user to create manager user
I have set permission to allow anonymous user to create page. but when the
I have a php page with 3 different forms. I create 3 separate print
i have to create an asp.net page dynamically on runtime. It should work like
I have a Create new account page. The form is in page named Register.php
I have a multiview control on my page and a menu to create a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.