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 6769187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:09:47+00:00 2026-05-26T15:09:47+00:00

I have a TextBox server control on a Web Form, say, txtDueDate . I

  • 0

I have a TextBox server control on a Web Form, say, txtDueDate. I don’t want to use DateTimePicker but want to use TextBox itself. The user enters date in dd/mm/yyyy format.

While passing this value to SQL Server 2005 (Express) stored procedure, I use something like:

cmdParameters.AddWithValue("@DueDate", Convert.ToDateTime(txtDueDate.Text));

The stored procedure has input parameter to handle this value and is declared as:

@DueDate SmallDateTime

I want to know the default format SQL Server 2005 uses internally to store this date. On my PC, the Windows XP Regional Settings are set to dd/mm/yyyy format. While viewing records through Management Studio, it is stored correctly. But I am worried about users who will be using this web application. The Windows Regional Settings may differ on their PC.

I want to be sure whoever queries the database, the date is displayed in dd/mm/yyyy format. If someone inserts, 02/01/2004, then it should not become a valid reverse date like: 01/02/2004.

  • 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-26T15:09:48+00:00Added an answer on May 26, 2026 at 3:09 pm

    A DateTime is a DateTime is a DateTime – it doesn’t “have” any (string-oriented) format when stored in SQL Server (it’s stored as a 64-bit long). If you pass in a parameter to a stored procedure as a DateTime already, you should be just fine! The value will be stored by SQL Server without changing any formatting – since it doesn’t have any formatting associated with it…

    The only point the date is represented in a given string format is when you look at it in SQL Server Management Studio, or when you convert it to a string format in e.g. your .NET app.

    When you need to somehow pass in a string-representation into SQL Server (e.g. for searching etc.), the one that’s the most robust and will work with any regional/language setting is the ISO-8601 date format: YYYYMMDD or alternatively (if you need the time portion) YYYY-MM-DDTHH:MM:SS (where the T in the middle is a literal, separating the date and time portions)

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

Sidebar

Related Questions

I have the following textbox server control in my web page: <asp:TextBox ID=txtZip runat=server
I have a TextBox control on my Form. I use the Leave event on
I use ASP.NET and C#. I have a RegularExpressionValidator control on a Web Form
I populate web form with dynamic list of exams from database. I want user
I have an asp.net web form with a couple of asp.net textbox controls: <asp:TextBox
I have created a web user control (MemberDetails.ascx) which is loaded dynamically on a
i have a login control and a create user control i my web page...i
I have made a web user control (.ascx) which consists of the two html
I have a user control that will render a textbox or file upload. I
How to rewrite Webconfig connection string at runtime.I have input textbox for Server,UserName and

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.