none
reading dbf, not all columns are filled RRS feed

  • Question

  • Hi all...

    We are facing a strange oledb behaviour: here is the code,


    oConn = new System.Data.OleDb.OleDbConnection();
    oConn.ConnectionString =
       "Provider=Microsoft.Jet.OLEDB.4.0;" +
       "Data Source=C:\\MyData;" +
       "Extended Properties=dBASE IV";
    oConn.Open();
    System.Data.Odbc.OdbcCommand oCmd = oConn.CreateCommand();

    oCmd.CommandText = "SELECT * FROM [" + this.strMandateNrOld + "A-PERS]";
    DataTable dtPers = new DataTable();
    dtPers.Load(oCmd.ExecuteReader());
    ...



    It works fine and it fills my DataTable, but when I analyze the content, I can see that some columns are not filled... In a table of 72 columns, 3 columns which content is DateTime and Char are blank, but we open it with DBAdministrator, the columns are completely filled..

    We tried changing the connection string, switching from ODBC to OleDb and the driver... but we always have the same problem...

    Does somebody have any idea or suggestion?
    Wednesday, October 31, 2007 9:52 AM