S
STom
I have a component that adds a few decimal numbers together to arrive at a
total but when I use my .Update function for my data adapter, I get the
following exception:
{System.Data.SqlClient.SqlException}
[System.Data.SqlClient.SqlException]:
{System.Data.SqlClient.SqlException}
HelpLink: Nothing
InnerException: Nothing
Message: "Error converting data type numeric to decimal."
Source: ".Net SqlClient Data Provider"
StackTrace: " at System.Data.Common.DbDataAdapter.Update(DataRow[]
dataRows, DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String
srcTable)
at BrightCompass.XALibrary.XADataAccess.UpdateCaseData(DataSet ds,
SqlConnection conn) in C:\Projects 2\Executive Advantage\DotNet
Version\EXE\ExecutiveAdvantage\XALibrary\XALibrary\XADataAccess.vb:line 441"
TargetSite: {System.Reflection.RuntimeMethodInfo}
Here is the code that calculates the number:
Me.BaseXACase.TotalAssets = CDec(Me.BaseXACase.CashNearCash) +
CDec(Me.BaseXACase.AccountsReceivable) + _
CDec(Me.BaseXACase.Inventory) +
CDec(Me.BaseXACase.OtherCurrentAssets)
In my update stored procedure,my parameters are declared as:
CREATE PROCEDURE dbo.UpdateLocalData
(
@intCaseDataID int,
@intModelID int,
@decNetIncome decimal (18,8),
@decTotalAssets decimal,
@intMonth int,
@intYear int,
@dtModifiedDate datetime
)
In my table design, the TotalAssets field is a decimal and it is also set to
(18,8).
So what I don't understand is why it thinks this is a numeric and not a
decimal. I have looked at this thing until I'm color blind. Can someone tell
me what I'm not seeing here?
Thanks.
STom
total but when I use my .Update function for my data adapter, I get the
following exception:
{System.Data.SqlClient.SqlException}
[System.Data.SqlClient.SqlException]:
{System.Data.SqlClient.SqlException}
HelpLink: Nothing
InnerException: Nothing
Message: "Error converting data type numeric to decimal."
Source: ".Net SqlClient Data Provider"
StackTrace: " at System.Data.Common.DbDataAdapter.Update(DataRow[]
dataRows, DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String
srcTable)
at BrightCompass.XALibrary.XADataAccess.UpdateCaseData(DataSet ds,
SqlConnection conn) in C:\Projects 2\Executive Advantage\DotNet
Version\EXE\ExecutiveAdvantage\XALibrary\XALibrary\XADataAccess.vb:line 441"
TargetSite: {System.Reflection.RuntimeMethodInfo}
Here is the code that calculates the number:
Me.BaseXACase.TotalAssets = CDec(Me.BaseXACase.CashNearCash) +
CDec(Me.BaseXACase.AccountsReceivable) + _
CDec(Me.BaseXACase.Inventory) +
CDec(Me.BaseXACase.OtherCurrentAssets)
In my update stored procedure,my parameters are declared as:
CREATE PROCEDURE dbo.UpdateLocalData
(
@intCaseDataID int,
@intModelID int,
@decNetIncome decimal (18,8),
@decTotalAssets decimal,
@intMonth int,
@intYear int,
@dtModifiedDate datetime
)
In my table design, the TotalAssets field is a decimal and it is also set to
(18,8).
So what I don't understand is why it thinks this is a numeric and not a
decimal. I have looked at this thing until I'm color blind. Can someone tell
me what I'm not seeing here?
Thanks.
STom