If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Pervasive.SQL > Wrong numeric values return in tables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-11-11, 16:09
aj1345 aj1345 is offline
Registered User
 
Join Date: Jul 2011
Posts: 2
Wrong numeric values return in tables

I am trying to read data stored in pervasive sql server from an application in c# and my code in c# is like this:

daBVData = new Pervasive.Data.SqlClient.PsqlDataAdapter("SELECT NUMBER,RECNO,SHD_DESCRIPTION,BVUNITPRICE FROM SALES_HISTORY_DETAIL", cnBVData);
daBVData.Fill(cRMDataSet.SALES_HISTORY_DETAIL);
daBVData.SelectCommand.Dispose();

I get the correct values for non numeric fields (like strings) but for numeric field the select statement returns values which are wrong, eg:

returns 9000001.20520 instead of 12052
or returns 9000000.14523 instead of 1452.31

Appreciate your help.
Reply With Quote
  #2 (permalink)  
Old 07-11-11, 16:29
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
Sounds like the DDFs may not have the correct data types for the fields in question. Can you read the DEMODATA tables correctly (to rule out a problem with the provider or the PSQL engine)?

Does PCC or ODBC Test return the correct values for the numeric fields?
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
  #3 (permalink)  
Old 07-12-11, 10:47
aj1345 aj1345 is offline
Registered User
 
Join Date: Jul 2011
Posts: 2
Quote:
Originally Posted by mirtheil View Post
Sounds like the DDFs may not have the correct data types for the fields in question. Can you read the DEMODATA tables correctly (to rule out a problem with the provider or the PSQL engine)?

Does PCC or ODBC Test return the correct values for the numeric fields?
If I read DEMODATA I get correct values everywhere.
I don't know what exactly you mean by PCC or ODBC Tests, can you elaborate please?
Thanks
Reply With Quote
  #4 (permalink)  
Old 07-12-11, 12:12
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
PCC is the Pervasive Control Center. It can execute queries and view data. ODBC Test is a Microsoft utility for executing queries against an ODBC Data source.

What I was suggesting would be to run your query through the PCC to see if the data is correct there. If it is, there might be a problem with the code or provider. If the data is incorrect in PCC, the problem might be in the DDFs and you'd need to talk to the vendor or developer that created the DDFs for the data files.
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On