Tracking Forums, Newsgroups, Maling Lists
Home Submit Tracker Forums
  Advanced Search


C# - Error - SqlDateTime Overflow - Must Be Between 1/1/1753 12:00:00 AM And 12/31/9999 11:59:59 PM

I have a MS SQL Srver 2005 Database, that has a table with a DatTime column. The DateTime column is of smalldatetime type. The date and time is auto generated by the DB using getdate() function. This is because its a LOG recording table, so logs are just inserted and date-time is generated by the db.

When creating a log and saving into the DB through Entity Framework, using LINQ query, it causes an error while saving saying:

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

upon investigating using breakpoints i have noticed, when Entity Framework tries to save the Log object, the date set by Entity Framework is set to:

01/01/0001 00:00:00

I guess this is why error is coming up. Is there any way to resolve this?

I am using .Net 3.5 framework.

View 1 Replies (Posted: Jan 18 at 12:22)

Sponsored Links:

Related Forum Messages For ASP.NET category:
SQL Server :: Got Error : SqlDateTime Overflow. Must Be Between 1/1/1753 12:00:00 AM And 12/31/9999
I am working on file upload in my application.When the file is upload,i found this error :

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

I cannot find solutions regarding to this error.Plz help me.Here is my codes where i think the error is come out.


Posted: Jan 03, 2011 02:15 AM

View 30 Replies!   View Related
DataSource Controls :: SqlTypeException: SqlDateTime Overflow. Must Be Between 1/1/1753 12:00:00 AM And 12/31/9999 11:59?
I'm new to 3.5 and I'm trying to develop a web site using ObjDataSources and LinQ to SQL. My tables often have optional date fields which have no value, e.g. Employee Termination Date. I was able to create a function when I used SQL DataSources that I wrapped around the parameters to replace the 12:00:00am with null and this worked great.

Now I'm trying to use ObjDataSources and LinqToSQL and its automatic updating and inserting. When I do, I get this horrible exception again. I have tried using my functions in the ItemUpdated event,


Public Shared Function MakeDateField(ByVal pasDate As String) As Nullable(Of SqlDateTime)

If IsDate(pasDate) Then[code]....

Posted: May 17, 2010 02:16 PM

View 2 Replies!   View Related
Time Overflow. Between 1/1/1753 12:00:00 AM And 12/31/9999 11:59:59 PM Error?
received this error when im trying to save the date in my database.SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.Data.SqlTypes.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.


Posted: Apr 07, 2009 01:01 AM

View 19 Replies!   View Related
ADO.NET :: SqlDateTime Overflow. Must Be Between 1/1/1753 12:00:00 AM And 12/31/999?
I am getting the above error when I am executing the below function.

public void InsertRecord(object sender, GridRecordEventArgs e)
DateTime Startdate = new DateTime(); [code]....

Posted: Jul 30, 2010 01:49 PM

View 3 Replies!   View Related
MVC :: SqlDateTime Overflow?
I am having problemsaddinga new user havingcreated a custom membership provider. The code is as follows:

beginDate = SqlDateTime.MinValue.Value;SqlDateTime.MaxValue.Value;
endDate = SqlDateTime.MinValue.Value;SqlDateTime.MaxValue.Value;
datetime = DateTime.Today;


Posted: Feb 11, 2011 01:11 AM

View 4 Replies!   View Related
MVC :: SqlDateTime Overflow With EF?
I am developing a website in mvc using Entity Framework. I have created some POCO (Plan old class objects) to represent the database entities.These POCO classes defines some entities with datetime type.

Now I have a view which contains a telerik datepicker. This view inherits the model which contains a nullable datetime object say searchDate.

When I fire a query to compain these searchDate with dates stored in database its throwing following error

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

following is the linq query i am using


The date format stored in database is "2011-01-31 00:00:00.000"

and the format comes from UI is "03-03-2011 00:00:00".

I am using SQL Server 2008 R2 and .net 4.0 framework.

Posted: Mar 04, 2011 09:07 AM

View 1 Replies!   View Related
DataSource Controls :: SqlDateTime Overflow Using Linq To SQL
I'm new to 3.5 and I'm trying to create a FormView based on Linq to SQL. My underlying table has several date fields that are optional and typically are not set. When I try to insert or update records, I get the following message.

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

I got the same message when using the SQLDataSource with this data, but I was able to create functions that tested the value of the datefield against the datetime.minvalue and if it was the minvalue, replace it with null.I can't figure out where to put the functions and how to reference the value of the date field. below is what I have


Public Shared Function MakeDateField(ByVal pasDate As String) As Nullable(Of SqlDateTime)
If IsDate(pasDate) Then
Try [code].....

How can I submit null dates when using Linq to SQL automatic updates and inserts?

Posted: May 17, 2010 03:06 PM

View 3 Replies!   View Related
MaintainScrollPositionOnPostBack Error : Stack Overflow At Line 0?
I have used aMaintainScrollPositionOnPostBack = true function in 2.0 but is giving a stack overflow at line 0 error. What is the fix to this. I understand that it is a bug in IE.

Posted: Mar 15, 2010 08:26 PM

View 2 Replies!   View Related
SQL Server :: While Executing Select Statement For A Table Then Getting Arithmetic Overflow Error?
While executing select statement for a table then iam getting arithmetic overflow error.I found that retrieviing the data for a particular column showed that error ,sum() for that column is showing error.Is there any way i can rectify this problem.

Posted: Sep 22, 2010 09:30 PM

View 10 Replies!   View Related
Forms Data Controls :: Gridview Sorting Stack Overflow Error?
This is very frustraiting because I have read a thousand posts on this and nothing works. I have a gridview which is programatically bound to a dataset which is created from dataset.readxml(xdocument.createreader). The table gets createdwithout issue.

I have allow sorting set to true. when i click the sorting linkbutton I get the event handler error. So i create an empty event handler and that doesn't give me an error but also accomplishes nothing. So I searched and searched and found that i need to call the gridview.sort method to programmatically sort in the event handler. So when i do this

GridView1.Sort(expression, SortDirection.Ascending)

as seen in


i get stackoverflowerror. it creates an infinate loop. none of the20 or so posts out there seem to answer how to handle this.They say that this method is the way to call sorting.

below is my event handler


the behaviour is that the event handler fires and executes to the sorting line which in turn refires the event handler.

Posted: May 10, 2010 07:55 PM

View 2 Replies!   View Related
DataSource Controls :: Datatype Numeric Error - "Arithmetic Overflow Error Converting Numeric To Data Type Numeric."?
i have set the type of a column in a table numeric(6,2) but when i insert a value above 9999,99 i get the error

"Arithmetic overflow error converting numeric to data type numeric."

Do you know whats wrong??

ofc thats all through visual studio for an asp site thats why im posting here

Posted: Apr 18, 2010 01:27 PM

View 4 Replies!   View Related
Databases :: Getting "OCI-22053: Overflow Error" While Trying To Fill OracleDataAdapter?
I keep getting "OCI-22053: overflow error" while trying to fill OracleDataAdapter.

I need to fill a DataTable with a set of data being return from an Oracle cursor.Some articles suggested to add "da.ReturnProviderSpecificTypes = true;" but the datatable is NULL after that was added.Below is my code.

OracleCommand cmd = new OracleCommand();
cmd.Parameters.Add("in_user_id", OracleType.Number).Value = Convert.ToDecimal(10493);
cmd.Parameters.Add("output_cursor", OracleType.Cursor).Direction = ParameterDirection.Output;
DataTable dt;
dt = this.spFillTable(cmd, ConfigurationManager.AppSettings.Get("myproject") + ".pk.getUserInfor", "dsUserInfo");
return dt;
catch (OracleException) { throw; }
finally { cmd.Dispose(); }
public DataTable spFillTable(OracleCommand cmd, String storedProcedureName, String tableName)
using (OracleConnection connection = new OracleConnection(this.ConnectionString))
cmd.Connection = connection;
cmd.CommandText = storedProcedureName;
cmd.CommandType = CommandType.StoredProcedure;
// Call the stored procedure
DataTable dt = new DataTable(tableName);
using (OracleDataAdapter da = new OracleDataAdapter(cmd))
return dt;

Posted: May 24, 2007 07:22 PM

View 2 Replies!   View Related
DataSource Controls :: Arithmetic Overflow Error Converting Numeric To Data Type Numeric
First of all im new to and am in the process of learning it.

Heres my problem, i am receiving this error when submitting the form: "Arithmetic overflow error converting numeric to data type numeric"

And it halts at command.ExecuteNonQuery();

Input form:


Code Behind:


Stored Procedure:


Posted: Feb 15, 2010 10:48 PM

View 11 Replies!   View Related
Web Forms :: Class Method Error "Arithmetic Operation Resulted In An Overflow"
I have a class that runs calculations onnumbers and populates the results tomy SQL database. My code behind page instantiatesthe class object, and in a loop it makes use of the method five times (once per loop). Essentially, my code behind collects the information from controls and passes the information to the class method for processing. The method works just fine most of the time.

On one of the iterations I get a error before the code even gets to the class. The error is, "Arithmetic operation resulted in an overflow." What strikes me as odd is that while stepping through the code,the loop crashes with that error before getting to the class that runs the calculations.Additionally, no arethmetic operations are performed on the form's code-behind page (which calls the method). I even put a break-point on the class constructor but the code crashed before reaching that constructor.

The information being sent is the results of matches from a sporting event. As a troubleshooting measure I changed the order of the matches by deleting them an re-entering them into the database in a different order.Again only this one particular match crashed. Here is the code that crashes:


Posted: Sep 28, 2010 08:11 AM

View 5 Replies!   View Related
Web Forms :: Error: "Stack Overflow At Line: 0"?
I get an error forthe belowcode in<script>. Until this line the images is loading fine:
img.src = "images/4.jpg"Butif I declare that line, I have an error message box that appears on the webpage:
"Stack overflow at line: 0"I have never had this error before and wonder what is causing this as I need to declare alot of images in this way. As seen I am downloading one image at a time from the server ant putting it to its controls wich works fine until this line of code.


Posted: Jul 21, 2010 03:25 PM

View 6 Replies!   View Related
DataSource Controls :: Passing A Date Before 1753 To SQL Server 2008?
I have a requirement to store dates before 1753 in my SQL Server 2008 database and to update these from ASP.NET.

I have created my table column as a date datatype rather than datetime.

My stored procedure has a parameter defined as a date datatype.

However, I have to create the parameter in ASP.NET with a typecode of DateTime (since this is the only relevant type available) and it appears that SQL Server first validates that parameter as a datetime even though I have defined it as a date (exception returned to ASP.NET is 'SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM').

For avoidance of doubt,I can specify a value of e.g. '1/1/1716' in an update query in Management Studio. So it is just a matter of how I get it into the SP from ASP.NET. Surely Microsoft must have thought of this when inventing the new datatype?

Posted: May 10, 2010 02:34 PM

View 3 Replies!   View Related
How To Hide Overflow Scroll Bar Of DIV
I have set a fix height of DIV and set its overflow-y:scroll but the problem is that if i have got data less than its height event though its showing scroll bar (disabled). how can i hide it... i mean give me solution so that the scroll bar will only show when data in that DIV is crossing height of DIV..

My code :

<div style="overflow-y:scroll; height:290px">
a data grid is here

Posted: Mar 31 10 at 12:07

View 1 Replies!   View Related
W3p.exe Terminated Due To Stack Overflow?
we are getting a stack overflow in production ~ 2-4 times / dayWe cannot reproduce this is in dev environment, nad given this is a web app with probably ~100 concurrent users at any one time, I'm struggling to work out how best to track this down.Is there anyway to get any more info from event viewer - happy to install some form of listener tool - even if i can just get teh thread identity (set to the current user) that'll help - although the dll + class / function woudl be great!

Posted: Nov 24 10 at 16:41

View 3 Replies!   View Related
Arithmetic Operation Resulted In An Overflow?
know why this does this?

Server Error in '/' Application.

Arithmetic operation resulted in an overflow.


Posted: Oct 19 10

View 2 Replies!   View Related
C# - How To Implement Stack Overflow's Feature
On this site if you do too many clicks or post comments too fast or something like that you get redirected to the "are you a human" screen. Does anybody know how to do something similar?

Posted: Mar 4 10 at 15:52

View 7 Replies!   View Related
AJAX :: ResizableControlExtender Overflow Does Not Work In IE6
I have made a solution with ResizableControlExtender in the Ajax control toolkit. It is a solution with a treeview on the left side of the screen and a content panel on the right side. Depending on what level in the treeview the user clicks at different content is shown in the right panel. What I want to do is to make it possible for the user to resize the width of the treeview. I have put the treeview in a panel and sets the target for the ResizableControlExtender to this panel. I have set the overflow style to auto. This works fine in all browsers except IE6. Unfortunately IE6 is an important browser for this solution. In IE6 the text of the treenodes is not cut when it is wider than the treeview width so it flows over the borders.The overflow works if I set a fixed width in the styleTreeView class but that makes it impossible to resize. I've tried to change the overflow setting in a lot of ways but nothing is working.


Posted: Oct 28, 2010 07:33 AM

View 1 Replies!   View Related
Web Forms :: Stack Overflow At Line 0?
When i execute my web page, it gets stack overflow at line :0 error

How can i solve this problem.

Posted: Jun 25, 2010 02:54 PM

View 2 Replies!   View Related
The Process Was Terminated Due To Stack Overflow
using framework 4.0 keep giving me this error:

Event Type:Error
Event Source:.NET Runtime
Event Category:None
Event ID:1027
Application: w3wp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to stack overflow.

For more information, see Help and Support Center at [URL]

Posted: Jul 07, 2010 09:17 PM

View 3 Replies!   View Related
Center Preloader - Browser Content Overflow
I have AJAX website. In postbak there is a AJAX UpdatePrecess within that preloader image(gif) image.I want to center in on it browser. Some time browser content overflow(only vertically).

Posted: May 4 09

View 6 Replies!   View Related
Web Forms :: Arithmetic Operation Resulted In An Overflow?
I do not understand how this problem happens, and I need help. The code below is very simple. It collects data entered into controls; instantiates a class; then sends the data to a class method for processing. No resulting value is returned to this code.You can see that there are no areithmetic operations performed on the data, but I sometimes get the error "arithmetic operation resulted in an overflow" right here on the last line cRating.SetRating(etc...).


The class methoduses the player id values (single) for the two players(iHPlayerID and iAPlayerID) to find their rating values. Calculations are made and the database is updated.Observation 1:I don't want to discuss the class method too much because, and this is the odd part,the code behind breaks before reaching the class. I have inserted a breakpoint at the start of the class method and ran the code. The error occurrs and the class codenever appears.

Observation 2:I mentioned that the class uses the players' ID values to look-up their rating from the database and round that value (single) to an integer. The code works just fine if the integer values of the players and not the same. The code fails and gives the error every time if the integer values are the same. How can this happen if the class code never executes?

Posted: Sep 30, 2010 06:31 AM

View 2 Replies!   View Related
VS 2010 Make The Gridview Header To Be Fixed On Overflow?
How to make the gridview header to be fixed on overflow. I used this cssclass for Header Style but not working properly with all browsers.


position: relative; top: 0;

Posted: Jan 31st, 2011, 11:04 AM

View 1 Replies!   View Related
AJAX :: Overflow Auto Not Working Inside Updatepanel
overflow auto not working inside updatepanel

Posted: Oct 01, 2010 06:58 PM

View 3 Replies!   View Related
SQL Server :: Arithmetic Overflow When Converting String To Date
using sql server 2005. I am working with an existing database field and there is a field where the string in this format: YYYYMMDD, for example 05/16/2002 is displayed as:


anyways I am trying to convert that string to a date like so:


however when I try to do this I am getting the following error

Arithmetic overflow error converting expression to data type datetime.

does anyone know a good solution for this? I just want to convert the string to datetime so I can use the value in my WHERE clause.

Posted: Mar 24, 2011 08:33 PM

View 6 Replies!   View Related
Forms Data Controls :: ComboBox Width Overflow?
Im using a combobox that seems to be wider than it should be. Does anyone have a suggestion or fix for the problem.

Posted: Nov 19, 2010 03:47 AM

View 3 Replies!   View Related
Forms Data Controls :: How To Have A Vertical Scrollbar Appear In Div / Datagrid Without Using Overflow
Is it possible to show from the begining a vertical scroll bar associated with a datagrid control, i want to avoid using overflow property in div:

<div id="Div1" style="OVERFLOW: auto; WIDTH: 730px; HEIGHT: 260px" runat="server">
<asp:datagrid id="OrdersDG" runat="server" Width="700px" CssClass="GridTextboxes" DataKeyField="orderid"

Posted: Jan 25, 2010 09:21 PM

View 3 Replies!   View Related
Web Forms :: Can Make A Label More Than One Line To Hold Text Overflow
I am pulling data from my table, but have it assigned to a label that is too short. I don't want the label to expand horizontally. Is there a way to make the label multiple lines? For reasons not mentioned, I need to get the data into a label using a while statement instead of with a datalist, repeater, etc.

Posted: Nov 10, 2009 03:27 PM

View 2 Replies!   View Related
Web Forms :: Arithmetic Operation Resulted In An Overflow 2.0 Textbox Control?
I have a textbox written as:


The relevant section of the code behind file is:


Here's the snippet from cItemProperties.vb:


Posted: Dec 30, 2009 04:47 AM

View 5 Replies!   View Related
Make Gridview Header Fixed When Overflow Property Is Enabled?
I want user to be able to scroll in a div to see all the rows. But setting div's overflow property to true. When I starts scrolling header goes away. Is it possible to make header static. So that I can sort or do any kind of other operations.

Currently I tried to take fixed table above grid and hiding grids header. But on editing it is not expanding as the grid is expanding.

Posted: Sep 15 10 at 7:41

View 1 Replies!   View Related
Javascript - Implement Search Textbox As In Stack Overflow Website?
I have a search textbox in the web page. When the user presses enter key after entering text in that textbox then the search function should get executed. How to do this?

Posted: Sep 16 10 at 9:57

View 5 Replies!   View Related
Visual Studio :: Open File Tabs Overflow To Multi-line?
Just wondering if it is possible to set it so that when you have too many files open in Visual Studio, rather than display the little down arrow icon, it drops the tabs down onto another line?

Posted: Jan 27, 2011 12:35 PM

View 5 Replies!   View Related
C# - "Arithmetic Operation Resulted In An Overflow." ContentLength Is Always -2?
I have an update panel that works lovely in my test solution but when I put it into the main project it does not work correctly.I've made it very simple, but still no joy, it consists of:the file upload controla link buttonthe link button has an onclick method that takes the file and creates a byte array. For some reason the contentLength is -2 every time. It does not matter what type of file I am using. Every time!
This is very frustrating considering it works fine in my test solution.Is there anything I am missing or should be looking at? EDIT:I am using VS2008CODE:

<html xmlns="">
<head id="Head1" runat="server">


Posted: Mar 31 at 15:48

View 2 Replies!   View Related
Forms Data Controls :: Data Presentation Control In A Div With Overflow?
I have a data control (DataList, ListView, GridView,... I don't matter wich of them); there is too much items to show in it, so I put it inside a div with overflow auto.

The problem is that when I select a item in control it generates a post back and I lost the position of scroll in div. How can I solve it?

It's easy if I put a DropDownList, but my boss don't want it... :S

Posted: Oct 26, 2009 03:58 PM

View 3 Replies!   View Related
Databases :: Using A Grid Component And Displaying A Number Datatype With A Large Number Of Decimal Places Throws An Arithmetic Overflow Condition?
Using a grid component and displaying a number datatype with a large number of decimal places throws an Arithmetic Overflow condition.

Posted: Jun 11, 2009 07:15 PM

View 5 Replies!   View Related
DataSource Controls :: SSIS Job Failed With Error Error Code: 0x80004005 OLEDB Error
Executed as user: MACSTEELUSA.COMsa. ...9.00.3042.00 for 32-bit Copyright (C) Microsoft Corp 1984-2005. All rights reserved. Started: 8:00:17 PM Error: 2010-06-02 20:00:18.56 Code: 0xC0202009 Source: CRM_ORACLE_ARSUMMARY Connection manager "SourceConnectionOLEDB" Description: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft OLE DB Provider for Oracle" Hresult: 0x80004005 Description: "Oracle client
and networking components were not found. These components are supplied by Oracle Corporation and are part of the Oracle Version 7.3.3 or later client software installation. Provider is unable to function until these components are installed.". End Error Error: 2010-06-02 20:00:18.58 Code: 0xC020801C Source: Data Flow Task Source - Query [1] Description: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireCon... The package execution fa... The step failed.

Tasks Taken:Went to this folder checked for tnsnames.ora file but it is in good shape.


Posted: Jun 06, 2010 10:22 PM

View 2 Replies!   View Related
Copyright 2005-08, All rights reserved