Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2011
    Posts
    2

    Unanswered: 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.

  2. #2
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4
    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.

  3. #3
    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

  4. #4
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •