Arithmetic overflow error converting float to data type numeric.

When this code executes, I am getting the error list in the subject.  The values of the items are as follows:

newTextName = SM1
newLat = 29.1878
newLong = 85.3417
newDescription = Test
newCreator = John
newCreate_Date = 9/14/2003
newDepth = 61
DropDownList2 = 7


'Get next Text_ID from Waypoint Table
stmMaxSQL = "Select Max(WP_Text_ID) as WP_Text_ID From TBL_NM_Waypoint"
objConn.Open()
dadWaypoints = New SqlDataAdapter(stmMaxSQL, objConn)
dadWaypoints.Fill(dstWaypoints, "Waypoints")
objConn.Close()
strMaxID = Convert.ToString(CInt(dstWaypoints.Tables(0).Rows(0)("WP_Text_ID")) + 1)
dstWaypoints.Clear()
dstWaypoints.Dispose()

strTextID = Microsoft.VisualBasic.Right("0000" + Convert.ToString(strMaxID), 5)
strTextName = CType(e.Item.FindControl("newTextName"), TextBox).Text
decLat = Convert.ToDouble(CType(e.Item.FindControl("newLat"), TextBox).Text)
decLong = Convert.ToDouble(CType(e.Item.FindControl("newLong"), TextBox).Text)
strDescription = CType(e.Item.FindControl("newDescription"), TextBox).Text
strCreator = CType(e.Item.FindControl("newCreator"), TextBox).Text
dtCreate_Date = Convert.ToDateTime(CType(e.Item.FindControl("newCreate_Date"), TextBox).Text)
intDepth = (CType(e.Item.FindControl("newDepth"), TextBox).Text)
intTY_ID = (CType(e.Item.FindControl("DropDownList2"), DropDownList).SelectedItem.Value)

stmSQL = "Insert Into TBL_NM_WAYPOINT (WP_Text_ID, WP_Text_Name, WP_Lat,
WP_Long, WP_Description, WP_Creator, WP_Create_Date, WP_Depth, WP_Type) Values
(@TextID, @TextName, @Lat, @Long, @Description, @Creator, @Create_Date, @Depth,
@TypeID)"
cmdSQL = New SqlCommand(stmSQL, objConn)
cmdSQL.Parameters.Add("@TextID", strTextID)
cmdSQL.Parameters.Add("@TextName", strTextName)
cmdSQL.Parameters.Add("@Lat", decLat)
cmdSQL.Parameters.Add("@Long", decLong)
cmdSQL.Parameters.Add("@Description", strDescription)
cmdSQL.Parameters.Add("@Creator", strCreator)
cmdSQL.Parameters.Add("@Create_Date", dtCreate_Date)
cmdSQL.Parameters.Add("@Depth", intDepth)
cmdSQL.Parameters.Add("@TypeID", intTY_ID)
objConn.Open()
cmdSQL.ExecuteNonQuery()
objConn.Close()
0
jtwright
9/15/2003 5:19:01 AM
asp.net.object-datasource 16182 articles. 0 followers. Follow

4 Replies
763 Views

Similar Articles

[PageSpeed] 58

What line of code does the error occur on?

Don
Don Kiely, MCP, MCSD
In the Last Frontier, Interior Alaska
Please post questions and replies to the forum! And remember to MARK AS ANSWER when someone definitively answers a question or resolves a problem!
0
donkiely
9/15/2003 5:56:36 AM
It says that it is occurring on the cmdSQL.ExecuteNonQuery()

0
jtwright
9/15/2003 1:06:06 PM
Two more questions, then I think we can solve this. What are the data types of the variables you are using to pass the values to the command parameters? What is the structure of the TBL_NM_WAYPOINT table?

Something isn't converting right, it's just a matter of sorting through it to figure it out.
Don
Don Kiely, MCP, MCSD
In the Last Frontier, Interior Alaska
Please post questions and replies to the forum! And remember to MARK AS ANSWER when someone definitively answers a question or resolves a problem!
0
donkiely
9/17/2003 5:32:59 PM
I actually just figured out the answer.  A decimal in a trigger on the table did not have the correct scale.  Thanks for your help.
0
jtwright
9/17/2003 8:32:20 PM
Reply:

Similar Artilces:

SQL Server Error: "Arithmetic overflow error converting numeric to data type numeric"
I'm still quite new to SQL, and so I may be missing something quite obvious. Apologies in advance if that's the case. I've included my query at the bottom of the message as it is quite long; my problem is that I get "Arithmetic overflow error converting numeric to data type numeric" when the first parameter to my COALESCE calls is not NULL. That is, the COALESCEs and the query work as I expect when SUM(cust_vw_actual.Actual) is NULL (they return 0.00), but if it isn't I get the error. I am also getting "Warning: Null value eliminated from aggregate.&...

Help needed: arithmetic overflow error converting numeric to data type numeric
Hi, I have a SQL server 2005 db. The table structure (from big list of columns, only decimal columns I mentioned) below.  CREATE TABLE [Product].[MetricMeasures](    [MetricMeasureID] [int] IDENTITY(1,1) NOT NULL,    [ProductID] [int] NOT NULL,    [ProductSizeValue] [decimal](4, 2) NULL,    [ItemWeightValue] [decimal](3, 3) NULL,    [MasterCartonWeightValue] [decimal](3, 3) NULL,    [MasterCartonVolumeValue] [decimal](4, 4) NULL, CONSTRAINT [PK_MetricMeasures] PRIMARY KEY CLUSTERED ( &nbs...

Arithmetic overflow error converting varchar to data type numeric
Hello, i am getting "Arithmetic overflow error converting varchar to data type numeric"  while i am trying to cast the numeric value to varchar in SQL Server 2000(This is the Query  (cast(' + @Qty + ' as varchar(50)) If any knows plz help me, thanks.        "Arithmetic overflow error converting varchar to data type numeric" stands for error while converting varchar to numeric, and you say "trying to cast the numeric value to varchar", this is kind a confusing thing. Can you explain your problem more detailed?Nev...

Error = Arithmetic overflow error converting expression to data type smalldatetim
  $exception {"Arithmetic overflow error converting expression to data type smalldatetime.\r\nThe statement has been terminated."} System.Exception {System.Data.SqlClient.SqlException} occurs here is my code protected void EmailSubmitBtn_Click(object sender, EventArgs e) { SqlDataSource NewsletterSqlDataSource = new SqlDataSource(); NewsletterSqlDataSource.ConnectionString = ConfigurationManager.ConnectionStrings["NewsletterConnectionString"].ToString();   //Text version NewsletterSqlDataSource.InsertCommandType = SqlDataSourceCommandType.Text; NewsletterS...

Trying to convert column from datatype nvarchar to datetime
Hi All,  I am trying to simply change a column from a datatype of nvarchar to a datetime datatype.  However when I do I receive the following error message: " Arithmetic overflow error converting expression to data type datetime."To note there is already a date filled out in the columns which I presume the reason why the error is reporting?! however for some reason when originally setup datetime was not used but rather nvarchar to capture the data.The format is: 16/01/2007 09:53:50 There are around 24000 entries that I need converting somehow so if anyone can help...

Arithmetic overflow error converting expression to data type datetime
Hi all,In the beginning of this month I've build a website with a file-upload-control. When uploading a file, a record (filename, comment, datetime) gets written to a SQLExpress database, and in a gridview a list of the files is shown. On the 7th of September I uploaded some files to my website, and it worked fine. In the database, the datetime-record shows "07/09/2006 11:45". When I try to upload a file today, it gives me the following error: Error: Arithmetic overflow error converting expression to data type datetime. The statement has been ...

Arithmetic overflow error converting expression to data type datetime
Hi, I have the problem stated Arithmetic overflow error converting expression to data type datetime...  I have little idea on y the error occur...Need help asap if possible... suggestions , ideas My sql server 2000 database has the table custTransaction and some field name... dateOfPurchase is the field name in the table that i store the date format as nvarchar and in the format of dd/MM/yyyy... because does not have value larger den 12 there4 this error occur when i try retrieve data from database... Q: My qns is how can i dun change the format of my dateOfPurchase and retrieve ...

Arithmetic overflow error converting expression to data type datetime
Hi,I don't know why I'm still having this error even if the only part that deals with the date fields are only using getdate() function.SQL Server Database Error: Arithmetic overflow error converting expression to data type datetime.The statement has been terminated.Many Thanks & Best Regards,HuaMin Chen(Mark it as answer if it does help you!)  Can you post your code to get understanding of your problem clearyly.  Thanks,santosh_maharajaPlease mark as answer if you got expected solution. wmec:SQL Server Database Error: Arithmetic overflow error converting expressi...

Arithmetic overflow error converting expression to data type datetime.
I have the error message:Arithmetic overflow error converting expression to data type datetime. when i click this button:    protected void Button2_Click(object sender, EventArgs e)    {         Int32 ProductId = Convert.ToInt32(Request.QueryString["proID"]);        bool result = Executeupdateclickedin(ProductId);        result = Executedeleteshipping(ProductId);        result = Executemassmail2(ProductId);&nb...

Arithmetic overflow error converting expression to data type datetime.
Hi. My query below executes perfectly in SQL query analyzer.SELECT     pre_e.......... recruitment_advertising.advertising_date, career_details.RTS_Email, datediff(d,Cast(recruitment_advertising.advertising_date as DATETIME),CAST(career_details.RTS_Email as Datetime)) as Ad_to_RTS_daysFROM         pre_employee INNER JOIN..........advertising_date is of type nvarchar and so is RTS_EmailThey ARE in the format dd/mm/yyyy  (GB format).But when I create a dataset and  objectdatasource using the same query to use in the reportvi...

Arithmetic overflow error converting expression to data type datetime #2
Hi, I'm having this error with my page, user picks the date -using the AJAX Control Toolkit Calender with the format of ( dd/MM/yyyy ). It looks like the application current format is MM/dd/yyyy, because it shows the error page if the day is greater than 12,  like: 25/03/2007 What is wrong? Here is the error page: Server Error in '/' Application. Arithmetic overflow error converting expression to data type datetime.The statement has been terminated. Description: An unhandled exception occurred during the execution of the current web request. Please review ...

Re: Arithmetic overflow error converting expression to data type datetime
I have a sql server 2000 database...using vb.net 2005... I have a form which allow user to find outstanding transaction by month selected in dropdownlist... If it matches the month it will populate out in datagrid, this date is store as dd/MM/yyyy... below is the following code:  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If ddl_payment.SelectedItem.Text = "Outstanding" Then ddl_months.Visible = True datagrid1.Visible = False If ddl_months.Visible = True...

Arithmetic overflow error converting expression to data type nvarchar.
Hi - I am a fairly new VB 2005 programmer.  I have a stored procedure, with a number of parameters, including "Monthly_Amount".   Here is the Stored Proc definitiion:   @Monthly_Day_Source nchar(2) = null,@Monthly_Amount_Source decimal(15,2) = null In the Stored Procedure and the ObjectDataSource associated with the Insert and Update Stored procedures, Monthly_Amount_Source is Decimal(15,2).    Monthly_Amount_Source is a parameter used by the Stored Procedures and does not exist in the database.  Detailsview shows:  <asp:Boun...

Web resources about - Arithmetic overflow error converting float to data type numeric. - asp.net.object-datasource

Arithmetic - Wikipedia, the free encyclopedia
... of numbers , especially the properties of the traditional operations between them— addition , subtraction , multiplication and division . Arithmetic ...

Arithmetic - Wikipedia, the free encyclopedia
... numbers , especially the properties of the traditional operations between them — addition , subtraction , multiplication and division . Arithmetic ...

Mental Arithmetic - train your brain! on the App Store on iTunes
Get Mental Arithmetic - train your brain! on the App Store. See screenshots and ratings, and read customer reviews.

Arithmetic Puzzle - Haskell live coding - YouTube
Live coding of Ruby Quiz 7 - Arithmetic Puzzle "Countdown" Unscripted, unedited, (uncut) - Haskell Uncut Read more at my blog post: http://c ...

Australia's deadliest sniper, Ian Robertson, 'never did the arithmetic'
The deadliest man in Australia comes from Melbourne, but he is not a gangster or a hitman. He is more a foxtrotting man, these days. He can do ...

Genetic anomaly could explain severe difficulty with arithmetic - The Science Show - ABC Radio National ...
... is that numbers are wired into the human brain and perhaps a genetic anomaly explains why some children have severe difficulties with arithmetic. ...

Help your kids master arithmetic with Monster Math 2
... upgrade to Monster Math 2 Pro and get access to new worlds, more advanced reporting, and all of the math skills. Help your kids master arithmetic ...

Price Drop: MencalHD:Mental Arithmetic Training,Improve Your Skills In Math
MencalHD:Mental Arithmetic Training,Improve Your Skills In Math 1.0 Device: iOS iPad Only Category: Education Price: Free, Version: 1.0 ( iTunes ...

Analysis: Republicans' budget plans require creative arithmetic to add up
Pittsburgh Post-Gazette Analysis: Republicans' budget plans require creative arithmetic to add up Bellingham Herald WASHINGTON — Republicans ...

"Here's America today... frivolous entertainment, texting and Twitter replacing serious news reporting ...
If only we weren't so frivolous , if we could get serious , maybe we could figure it all out.

Resources last updated: 12/30/2015 6:31:31 AM