Data Type Problem

  • Thread starter Thread starter Savas Ates
  • Start date Start date
S

Savas Ates

I have a field in my table which has currency values like this
41.2
10
24.12

in my vb.net application i have a variable which i assigned as decimal

Dim mymoney as Decimal
mymoney =xx("mymoney")
I tried
Response.write mymoney

it returns 412 instead of 41.2

i tried
response.write xx("mymoney")

it returns 41.2

which kind of data type i should use ?
 
Savas said:
I have a field in my table which has currency values like this
41.2
10
24.12

in my vb.net application i have a variable which i assigned as decimal

Dim mymoney as Decimal
mymoney =xx("mymoney")
I tried
Response.write mymoney

it returns 412 instead of 41.2

i tried
response.write xx("mymoney")

it returns 41.2

which kind of data type i should use ?

Make sure you turn option strict and option explict on in your program.

What is the datatype in database?
What is the type of database?
What is your select statement?
Is xx a datatable or a datareader?
If you are debugging what is the value in mymoney?

Chris
 
in my mssql database
ProductPrices_Sale_Customer as float size =8

this my stored proc statement
CAST ( LEFT (ProductPrices_Sale_Customer,5) AS Decimal)AS BizdekiFiyat,

xx = rs.ExecuteReader

it is supposed to be 41.2
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top