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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:38:35+00:00 2026-06-09T11:38:35+00:00

I have a problem using the calender control .. I am getting the date

  • 0

I have a problem using the calender control .. I am getting the date in a textbox… and I have to insert this into the database .. using asp.net with c#

In my web application the field property is set to datetime and in the table the column’s datatype is date..

How can I do this??

The error I am getting is:

The conversion of a varchar data type to a datetime data type resulted
in an out-of-range value. The statement has been terminated.

Could anyone help me in this regard?

Thanks in advance

  • 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-06-09T11:38:36+00:00Added an answer on June 9, 2026 at 11:38 am

    The error i am getting is: The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.

    It sounds like you’re trying to insert it as a string, which is a generally bad idea. You should use parameterized SQL and set the value as a parameter, still as a .NET DateTime. See the docs for SqlCommand.Parameters for an example of parameterized SQL. You should always keep data in its natural type for as long as possible.

    Of course, it’s then still possible that you’ll get this error if you try to insert a DateTime value which is out of the range that SQL can store. In particular, I believe SQL has a lower limit of 1753 as the year. If your value is DateTime.MinValue for some reason (January 1st, 1AD) then you’d still get this problem. Have you added diagnostics for the value you’re trying to insert?

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

Sidebar

Related Questions

I have problem while using jquery maskedinput with asp.net textbox. I have a check
i am using a calendar extender control in my asp.net web application. i want
I have a problem using a local SQL Server CE database with C# and
I have a problem using the SSIS. I try to import data from database
i have a problem using the Catch Clipboard Events code found on this link
I have a asp.net page with uses a JQuery and a web service to
I have a asp.net web app. In my master page I have a calendar
I have problem using arabic font for iOS. All fonts have the same render,
i have problem using LIKE structure in DB2 : for example: select * from
I have a problem using Linq to NHibernate to load an object and eagerly

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.