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

  • Home
  • SEARCH
  • 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 3236306
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:36:24+00:00 2026-05-17T17:36:24+00:00

I have developed the asp.net mvc 2 + C# application. it has create functionality

  • 0

I have developed the asp.net mvc 2 + C# application. it has create functionality in which there is datetime field. If locally I runs the a application it is working fine . but if i deploys it on IIS server (v 5.1) it, is not accepting date more than 12 (if gives 14/10/2010) will not work), this means it is changing the date format at run time on iis as MM/dd/yyyy. But in insert code I am converting the format in “dd/MM/yyyy” by this line :

objRecord.NextElectionDate = DateTime.ParseExact(collection[“NextElectionDate1”], “dd/mm/yyyy”, null);

I checked the regional settings , it is same as where i locally running application (US cultured) .Not any exception getting out.Also I tried to deploy application on iis 6.0 , where it is running perfect. But on client side there is IIS 5.1 version available so the application must be run somehow on IIS 5.1. Is this date problem cause of the IIS version. How to resolve this issue ?

Edited 1:
alt text

I have code like this :

alt text

Edited 2: Hi again ! while I am debugging the application I am getting ModelState.IsValid is “false” ,while trying to insert officer information on “Create” Action . how to know what is going wrong in ModelState.IsValid ? why should it is getting “false” ? Please guide

  • 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-17T17:36:24+00:00Added an answer on May 17, 2026 at 5:36 pm

    Your problem has nothing to do with IIS. It is a classic database datetime formatting issue.

    More than 12 gives you the answer: there are only 12 months in the year! So:

    Do NOT format the date in the “insert code” to anything other than US format, as your database storage will expect the dates in US format.

    I have seen this time and again with MS Access databases.

    The simple solution is ALWAYS ensure that the dates you use in your Edit and Insert code have been formatted for US culture, ie, mm/dd/yyyy.

    Darin Dimitrov is right about the Model Binder practice he mentions. But the more serious issue here is a square peg in round hole one: As Microsoft is a US company, their databases want dates in US format.

    In MS Access, if the data input goes through a form, you are fine just relying on your PCs culture settings. However, if you insert data using VBA code, you need to explicitly format dates in US format.

    That is exactly what is happening here.

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

Sidebar

Related Questions

I am looking at globalizing an application that I have developed in asp.net mvc.
I am using asp.net MVC to develop an application that will have ajax interactions.
I have a web application developed with ASP.net and C# that is running on
I have an ASP.NET application developed on my Vista box (IIS7). It works fine
We have hundreds of websites which were developed in asp, .net and java and
I have a site developed in ASP.NET and hosted on a windows server using
I have two web applications and both are developed in ASP.NET. Now I want
I'm interested in seeing what custom extensions other developers have created for the ASP.NET
I have been asked to develop some usercontrols in ASP.NET that will at a
We have developed a large number of websites using ASP (jscript flavour), talking to

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.