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

i m getting an error while passing date value in the stored procedure from the frontend (asp.net) and sql server 2005 as backend.

Error.

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

0
SoftwareEngineer2008
8/3/2008 1:01:31 PM
asp.net.object-datasource 16182 articles. 0 followers. Follow

5 Replies
932 Views

Similar Articles

[PageSpeed] 38

 What value are you passing to SQL?


Community Coder
0
jamesqua
8/3/2008 1:21:21 PM

 Please also post the code you are calling the database with.


Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
0
TATWORTH
8/3/2008 5:21:41 PM

SqlCmd = New SqlCommand("sAdd", conn1)

SqlCmd.CommandType = CommandType.StoredProcedure

SqlCmd.Parameters.AddWithValue("@ddate",start.date)  'start is dattime control

SqlCmd.ExecuteNonQuery()

0
SoftwareEngineer2008
8/4/2008 4:24:51 AM
SqlCmd = New SqlCommand("sAdd", conn1) SqlCmd.CommandType = CommandType.StoredProcedure SqlCmd.Parameters.AddWithValue("@ddate",start.date) 'start is dattime control SqlCmd.ExecuteNonQuery()
0
SoftwareEngineer2008
8/4/2008 4:25:45 AM

 There are two possible fixes to this:

  • Cast start.Date to a regular DateTime variable
  • Use Parameters.Add instead of  Parameters.AddWithValue
Parameters.AddWithValue does not always get the conversion right.

Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
0
TATWORTH
8/4/2008 7:55:12 AM
Reply:

Similar Artilces:

SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM Error.
hi there, i 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.Source Error: Line 238: local_sqlCommand.Parameters.Add(New SqlPa...

Error: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
 Hi,when deleting something from my datagrid I keep getting this error even though the date in the column that contains a data is between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. any suggestions? thx already!  Not really sure why you would get this error if you were deleting a record, are you using the a date as part of a key to perform the delete. Maybe some kind of archiving is happening that is causing the error. Either way I believe this to be a SQL error rather than a code error. I would check all the database actions being performed when selecting the reco...

PLEASE HELP ME: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
I cannot for the life of me figure out why im still getting this error. I have tried everything i can think of from using dbnull.value to setDOBnull() to datetime.minvalue. Can anyone help me? Here's the code on my BLL:    Public Function AddEmployee(ByVal SSN As String, ByVal FirstName As String, ByVal LastName As String, ByVal PreferredName As String, ByVal MaidenName As String, ByVal MaritalStatus As Nullable(Of Char), ByVal DOB As Nullable(Of Date), ByVal Gender As Nullable(Of Char), ByVal Ethnicity As String, ByVal StartDate As Nullable(Of Date), ByVal Termin...

SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
This error is bugging me: Here is my code: private void Button3_Click(object sender, System.EventArgs e)         {             Configuration cfg = new Configuration();             cfg.AddAssembly("WebApplication1");             ISessionFactory factory = cfg.BuildSessionFactory();             ISession session = factory.OpenSession();       &nbs...

SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
I've got a simple application that updates a table on SQL Server with some date information.  I developed the web app on my computer (Windows XP SP2) with Visual Studio, and everything works great.  I then deployed it to our Windows Server 2003 IIS server and the above error when I try to insert a DBNULL.Value into the stored procedure that executes it.  Why would they run differently?  Does the personal IIS on XP Pro work differently?!  Strange. I should say a little more about the testing I've done... the error always occurs when I leave the date field blank - in...

SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM
Tried to retrieve data from input dataset. But get this 'SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM' error. I guess it's a typical question. Can anybody help as soon as possible, please?!!!!!!!!!!!!!!!!!!!!!!!!!!!!! In .aspx page: <%# DataBinder.Eval(Container.DataItem, "StartTime", "{0:T}") %> In .aspx.vb: Dim StartTime As Date = Request.Params("StartTime") underneath page_load In Components/ProductsDB: Public Function GetProducts2c(ByVal categoryID As Integer, ByVal State As String, ByVal StartTime A...

SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
what's wrong with this one? and i am getting this error  Dim drpProjectCode As DropDownList 'Dim txtPRNo As TextBox Dim txtToName As TextBox 'Dim txtProjectName As TextBox Dim txtAttentionName As TextBox Dim drpCompanySite As DropDownList Dim txtDateOrdered As TextBox Dim txtDeliveryDate As TextBox Dim txtCompanyContactPerson As TextBox drpProjectCode = CType(FormView1.Row.FindControl("drpProjectCode"), DropDownList) ...

SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM
Hi there...  i have a search page with consitst of DatePicker and DataView this is how i'm binding my dataview <asp:ObjectDataSource runat="server" EnableCaching="false" ID="ods" TypeName="daab.Employee"                                                        S...

SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
hey, i will make calender(by use Asp.net 2003 - C# - framework 2.0 ) that stored and retreive data from Database(SQL Server 2000), that success , but if add this function (Calendar1_DayRender) Server Error in '/bwarq' Application. 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.SqlTypeEx...

SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM
Good morning,I receive the above error in a Formview's date fied when the field is left blank.  The SQL field allows for nulls. I am using a LINQ to SQL datasource.   From my reading, I have ascertained that since the field is empty it isbeing rperceived by SQL as out ot it's range of accepted dates.  I have attempted to ConvertEmptyString ="true", but to no avail.  I have read many posts on this issue, but haven't come accross a solution.  Ithe date fields markup is the following:  Date To:<asp:TextBox ID="Dat...

'SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM
************* Edited by moderator Adec *************** Inserted missing < code></ code> tags (without the spaces inside). Always include such tags when including code in your postings. Don't force the moderators to do this for you. Many readers disregard postings without the code tags. ************************************************** Tried to retrieve data from input dataset. But get this 'SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM' error. I guess it's a typical question. Can anybody help as soon as possible, p...

SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. #2
Yes, I've parsed many a topic on many a site regarding this issue.sigh.I am using a calendar control within a TemplateField on a DetailsView.I know that my SQL DB will accept NULL for my DATETIME field, because if I don't bind the control to the insert, the insert succeedes, yeilding a null for DATETIME in the new record.My problem is that I want the user to be able to choose to not select a date.    I find that I have to bind selected value to the insert parameter, so that if they do select a date, it get inserted.( duhh!! )      When I do tho...

SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. #4
Hi i get the following error when i run, my stored procedures, can anyone see what I am doing wrong;ALTER PROCEDURE [dbo].[FootballFixtures_SelectbyFootballCompetitionID] @FootballCompetitionID int, @FixtureDate datetime AS SELECT FOOTBALLFIXTURES_ID , HomeTeamID , t1.FootballTeamName AS HomeTeamName , AwayTeamID , t2.FootballTeamName AS AwayTeamName , dateadd(day,datediff(day,0,FixtureDate),0),FixtureTime, bFixtureCompleted FROM FootballFixtures INNER JOIN FootballTeams t1 ON HomeTeamID = t1.FOOTBALLTEAM_ID INNER JOIN FootballTeams t2 ON AwayTeamID = t2.FO...

SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. #3
 Hi, I am getting this error when trying to insert a datatime field from a webform:SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. at System.Data.SqlTypes.SqlDateTime.FromTimeSpan(TimeSpan value)The users inputs "2/3/2009"Here is my vb:  Dim dtStartDate As Date DateTime.TryParse(txtStartDate.Text, dtStartDate) dbComm.Parameters.Add("@start_date", SqlDbType.DateTime) dbComm.Parameters("@start_date").Value = dtStartDate  What am I doing wrong?Thanks  If I was helpfu...

Web resources about - help me"Error SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. - asp.net.object-datasource

Resources last updated: 12/11/2015 8:56:50 PM