473,394 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

SqlDateTime overflow when running procedure

I set up my parameters in code as follows :
Expand|Select|Wrap|Line Numbers
  1. lTTState.startDate = Today.AddDays(-10)
  2. lTTState.startDate = Today
  3. lSqlCmd.Parameters.Add(New
  4. SqlParameter("@startDate", SqlDbType.DateTime))
  5. lSqlCmd.Parameters("@startDate").Value =
  6. lTTState.startDate
  7. lSqlCmd.Parameters.Add(New SqlParameter("@endDate",
  8. SqlDbType.DateTime))
  9. lSqlCmd.Parameters("@endDate").Value = lTTState.endDate
  10.  
My dates are declared as datetime in the procedure.

When I run the application I get the following error :

SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM
and 12/31/9999 11:59:59 PM.

Any Ideas ?
Nov 19 '05 #1
1 1355
What exactly is the values of lTTState.startDate and lTTState.endDate?

Lars-Erik

"poppy" <an*******@discussions.microsoft.com> wrote in message
news:18****************************@phx.gbl...
I set up my parameters in code as follows :
Expand|Select|Wrap|Line Numbers
  1. lTTState.startDate = Today.AddDays(-10)
  2.  lTTState.startDate = Today
  3.         lSqlCmd.Parameters.Add(New
  4.  SqlParameter("@startDate", SqlDbType.DateTime))
  5.         lSqlCmd.Parameters("@startDate").Value =
  6.  lTTState.startDate
  7.         lSqlCmd.Parameters.Add(New SqlParameter("@endDate",
  8.  SqlDbType.DateTime))
  9.         lSqlCmd.Parameters("@endDate").Value = lTTState.endDate
  10.  

My dates are declared as datetime in the procedure.

When I run the application I get the following error :

SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM
and 12/31/9999 11:59:59 PM.

Any Ideas ?

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: FrodoBaggins | last post by:
Dear Team, Attempting to insert a record into a SQL database, using the command: command.ExcuteNonQuery(); Get the following error message in the event log: SQLDateTime overflow. Must be...
19
by: Jim | last post by:
I have spent the past few weeks designing a database for my company. The problem is I have started running into what I believe are stack overflow problems. There are two tab controls on the form...
1
by: Paperback Writer | last post by:
I need to insert null in a DateTime field and in the ASP.Net i got this error: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. How to accomplish that ?...
5
by: mlafarlett | last post by:
Alright..I've found lots of info on this error and most say assign System.DBNull.Value, System.Convert.DBNull, or System.Data.SqlTypes.SqlDateTime.Null to my stored proc param and the problem will...
3
by: Mike9900 | last post by:
Hello, I am getting SqlDateTime overflow if I use .NET remoting on Windows XP and Windows XP is the server where the SQL server is located at. If my computer is Windows 2003 where the sql...
1
by: lairpr | last post by:
I am having this kind of error when trying to insert a null value; SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. bellow is my code, thanks protected...
3
by: baburk | last post by:
HI I want to pass null or "" When I pass like that I got an error System.Data.SqlTypes.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59...
4
by: jhansi xavier | last post by:
SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
0
by: maolimix | last post by:
Hi to all, I have a trouble with datetime...now I explain.. I must to store to a C# variable the values from a "Datetime column" of Sql Server 2005. I tried 3 methods ...in the first two I never...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.