JessyRobinson1234
asked on
Error converting datatype nvarchar to float
I have a sqldatareader that uses the folowing stored procedure:
SELECT convert(nvarchar,REPLACE(C ONVERT(var char(25),C ONVERT(mon ey, NULLIF(round(Actual_Exempt _Spend,0), ''),NULL), 1),'.00', '')) Actual_Exempt_Spend
FROM BUDGET_ACTUAL
The VB Part looks like this:
rdr = cmd.ExecuteReader()
Dim Counter As Integer = 0
While rdr.Read
Counter = Counter + 1
Exit While
End While
If Counter > 0 Then
Me.txtASR.Text = rdr("Actual_Supplemental_R evenue").T oString
End If
When I run it throws the error converting datatype nvarchar to float.
Can anyone shed some light on this?
Thanks
SELECT convert(nvarchar,REPLACE(C
FROM BUDGET_ACTUAL
The VB Part looks like this:
rdr = cmd.ExecuteReader()
Dim Counter As Integer = 0
While rdr.Read
Counter = Counter + 1
Exit While
End While
If Counter > 0 Then
Me.txtASR.Text = rdr("Actual_Supplemental_R
End If
When I run it throws the error converting datatype nvarchar to float.
Can anyone shed some light on this?
Thanks
ASKER
That returns a NULL value while I have a value.
ASKER
Still getting the same error
waht do you really want to? can you give some example...
ASKER
Sure. I have a form that uses the update parameter. Once the values are updated I want to go back to the same form and display the updated values (e.g. textbox was initially empty, when I go back to the record it should prepolate the value which is coming from the stored procedure through the sqldatareader.
The error Error converting data type nvarchar to float occurs at
While rdr.Read
The error Error converting data type nvarchar to float occurs at
While rdr.Read
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That's a good question. It's carried over from a previous project. When I take it all out and just use the column values it works. I suppose there is a better way to do formatiing :)
ASKER
I am just going to focus on functionality for now.
SELECT convert(nvarchar,REPLACE(C
FROM BUDGET_ACTUAL