473,769 Members | 6,267 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Arithmetic overflow error converting expression to data type datetime" error

Hi!

I have created an SqlCommand object and I have set some parameters to it...
One of the parameters is of the DateTime type;

here is the code:
sqlCommand.Para meters[0].Value = DateTime.Parse( this.DateTextBo x.Text);
sqlCommand.Exec uteNonReader();

I get the error:
Arithmetic overflow error converting expression to data type datetime

thanks,
saso

Nov 15 '05 #1
4 25248
Hi!
What is in this.DataTextBo x.Text
DateTextBox is just a TextBox where the user enters a date (dd/mm/yy)...
the same thing happens if I enter DateTime.Now insted... I still get the
same error...
"Saso Zagoranski" <sa************ *@guest.arnes.s i> wrote in message
news:bp******** **@planja.arnes .si... Hi!

I have created an SqlCommand object and I have set some parameters to it... One of the parameters is of the DateTime type;

here is the code:
sqlCommand.Para meters[0].Value = DateTime.Parse( this.DateTextBo x.Text);
sqlCommand.Exec uteNonReader();

I get the error:
Arithmetic overflow error converting expression to data type datetime

thanks,
saso

Nov 15 '05 #2
"Saso Zagoranski" <sa************ *@guest.arnes.s i> wrote in news:bp85pd$93l
$1@planja.arnes .si:
Hi!
What is in this.DataTextBo x.Text


DateTextBox is just a TextBox where the user enters a date (dd/mm/yy)...
the same thing happens if I enter DateTime.Now insted... I still get the
same error...


And you are sure you aren't using us-time format? (mm/dd/yyyy)

this error usualy happens if you are entering dates with the wrong
formating.

greets
Peter

--
------ooo---OOO---ooo------

Peter Koen - www.kema.at
MCAD CAI/RS CASE/RS IAT

------ooo---OOO---ooo------
Nov 15 '05 #3
how can I check, which format I'm using?

saso

"Peter Koen" <koen-newsreply&snusn u.at> wrote in message
news:uH******** ******@TK2MSFTN GP11.phx.gbl...
"Saso Zagoranski" <sa************ *@guest.arnes.s i> wrote in news:bp85pd$93l $1@planja.arnes .si:
Hi!
What is in this.DataTextBo x.Text


DateTextBox is just a TextBox where the user enters a date (dd/mm/yy)...
the same thing happens if I enter DateTime.Now insted... I still get the
same error...


And you are sure you aren't using us-time format? (mm/dd/yyyy)

this error usualy happens if you are entering dates with the wrong
formating.

greets
Peter

--
------ooo---OOO---ooo------

Peter Koen - www.kema.at
MCAD CAI/RS CASE/RS IAT

------ooo---OOO---ooo------

Nov 15 '05 #4
although I just tried entering this date: 1.1.2003
this should be parsed no matter the format, right?

"Saso Zagoranski" <sa************ *@guest.arnes.s i> wrote in message
news:bp******** **@planja.arnes .si...
how can I check, which format I'm using?

saso

"Peter Koen" <koen-newsreply&snusn u.at> wrote in message
news:uH******** ******@TK2MSFTN GP11.phx.gbl...
"Saso Zagoranski" <sa************ *@guest.arnes.s i> wrote in

news:bp85pd$93l
$1@planja.arnes .si:
Hi!

> What is in this.DataTextBo x.Text

DateTextBox is just a TextBox where the user enters a date (dd/mm/yy)... the same thing happens if I enter DateTime.Now insted... I still get the same error...


And you are sure you aren't using us-time format? (mm/dd/yyyy)

this error usualy happens if you are entering dates with the wrong
formating.

greets
Peter

--
------ooo---OOO---ooo------

Peter Koen - www.kema.at
MCAD CAI/RS CASE/RS IAT

------ooo---OOO---ooo------


Nov 15 '05 #5

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

Similar topics

3
3515
by: Stan | last post by:
My webserver calls a component on another server through DCOM, the component goes to SQL, SQL raises the exception and here is what the client gets: "Cannot find member name System.Data.SqlClient.SqlError" I believe the issue is related to the fact that webserver runs the framework 1.1 and the component server has the framework 1.0 There are a number of posting in the different ng on this topic, but I cannot find a resolution.
1
2960
by: Amir | last post by:
Hi all, I have a table called PTRANS with few columns (see create script below). I have created a view on top that this table VwTransaction (See below) I can now run this query without a problem: select * from dbo.VwTransaction where
0
3959
by: s_gregory | last post by:
The mdb is considerable size 70 +- mb. A complex union query was working well, but when an additional union select... was added into the query, selecting identical fields from a different source, it began to have problems. Failure was observed only in a few PC's at first. For example, in an NT 4.0 SP6 PC, it continued to work OK. But in my Win 2k laptop, it failed. As the union query was gradually simiplified in testing, the failure...
3
14389
by: Karel Vandenhove | last post by:
Hi, I get an error "cannot apply indexing with to an expression of type object" when I try to compile the code below. SSLScannerManager is a COM component. (Used to access fingerprint scanners and developed by neurotechnologija) How does one get an array from a com component?
0
2422
by: rajmgopal | last post by:
Hello Everyone I am getting the following error when i try to insert a record into Sql Server 2005 from my VB 2005 application. sqlEx = {"Error converting data type numeric to numeric."} I checked for possible overflow exception, but did not encounter any. I have declared the values that i am trying to insert as DECIMAL data types in my VB code.
3
3295
by: Mejmeyster | last post by:
Hi Everyone, I have a table in which one of the text fields has become too small (since it only holds 255 characters). To remedy that, I'm trying to change the data type of that field to "memo" in design mode. However, when I go to save the new settings of my table, the error message "Record is too large" pops up and won't allow me to save the table. What am I doing wrong? I work with Access 97 in Windows XP. Thanks for your help!
3
6794
by: martin DH | last post by:
I would definitely appreciate any help with this problem as soon as possible. Thanks! I have a report that should display the results of a query based on two tables (tblClient and tblResult, linked by ClientID). When trying to open the report I receive the following error: "Data Type Mismatch in Criteria Expression" The report worked before, so as an experiment I created a new table with a structure identical to tblResult (so I...
5
5345
AAPWM
by: AAPWM | last post by:
Hello My job is to extract data from my companies database with Crystal Reports, export that data to Excel, modify the data, save the data as "Text "tab delimited"", and upload to the database once again. Ive done this for close to a year and have never had this error message. "Error converting data type varchar to numeric" 2255;2801 IMPORT LOG;IMPORT MAPPING INTERFACE;IMPORT MAPPINGS;SQL - CALL IMPORT ROUTINES;_DB ERROR Can...
1
2596
by: Ferwayne Yalung | last post by:
How can i fix the error? Private Sub cmdadd2_Click() If cmdadd2.Caption = "ADD" Then cmdadd2.Caption = "SAVE" cmdedit2.Caption = "CANCEL" buttons True, False a = Date a = Right(a, 4) With Adodc2.Recordset
0
10211
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10045
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9994
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3959
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3562
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.