none
.Dbf file column value chnaging RRS feed

  • Question

  • Hi everyone,

             I'm reading a dbf file to data table.. while i'm reading ,one of the column value(say price) is rounded of in DataTable after reading. Ex: Price is 99.099 in Dbf file.. after reading it to datatable it is 100..

    Code..

    System.Data.Odbc.

    OdbcConnection oConn = new System.Data.Odbc.OdbcConnection();

    oConn.ConnectionString =

    @"Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=C:\BDF\;Exclusive=NO; Collate=Machine;NULL=NO;DELETED=NO;BACKGROUNDFETCH=NO;";

    oConn.Open();

    System.Data.Odbc.

    OdbcCommand oCmd = oConn.CreateCommand();

    oCmd.CommandText =

    @"SELECT * FROM  path";

     

    OdbcDataAdapter da = new OdbcDataAdapter(oCmd);

    da.Fill(dt);

     In this dt the value of all the decimals are rounded..But in Dbf it is decimal value

    Pls let me know how can i get precise value from dbf..

    Thank u

     

     

     

     

     

    • Moved by SamAgain Tuesday, July 6, 2010 9:55 AM better fit (From:64-Bit .NET Framework Development.)
    Tuesday, July 6, 2010 9:01 AM

All replies