Storing decimals to Pervasive SQL database

H

Hans van de Laar

Within an VB.net application I'm trying to store decimal values to a
Pervasive SQL table. The decimal values comes from a xml file and is
looking something like:
<Grade1>6.65</Grade1>
<Grade2>6.66</Grade2>
<Grade3>6.0</Grade3>

When I look for the results in the database I find 665, 666 and 60 for
the corresponding columns. All types are setup as decimals. What I'm I
doing wrong?

Regards,
Hans
 
P

PvdG42

Hans van de Laar said:
Within an VB.net application I'm trying to store decimal values to a
Pervasive SQL table. The decimal values comes from a xml file and is
looking something like:
<Grade1>6.65</Grade1>
<Grade2>6.66</Grade2>
<Grade3>6.0</Grade3>

When I look for the results in the database I find 665, 666 and 60 for
the corresponding columns. All types are setup as decimals. What I'm I
doing wrong?

Regards,
Hans


It appears that Pervasive doesn't understand .NET System.Decimal. I'd ask
Pervasive tech support:

http://ww2.pervasive.com/Pages/Products.aspx (click the Support tab).
 
P

Patrice

It could be also a conversino problme issue. For example if you convert
those value with . as the thousand separator, it's likely you'll get the
same result (i.e. the point is dropped and it left you with 665, 666 and
60).

I would check where you convert text values to decimals and would check the
cultutre that you are currently using.
 
H

Hans van de Laar

Patrice,

Thanks, it seems indeed a culture info problem. I programmatically
changed the culture to "n-US" and I noticed the values are now stored
correctly into the database.

Thanks,
Hans
 

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

Top