Results 1 to 9 of 9

Thread: read dbase(dbf) files...OleDB?

Threaded View

  1. #1

    Thread Starter
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336

    read dbase(dbf) files...OleDB?

    Hey guys, I have some dBase files on my computer that I am trying to read with C#. I found some VB.NET code that I am trying to convert to C#, but I am getting an error that I can't figure out.

    on the rdr = cmd.ExecuteReader(CommandBehavior.SequentialAccess); line it says I am missing a required Parameter...however, there is only 1 parameter you can put there and that is the correct one.

    Is there something else that looks odd or wrong here?

    Thanks!



    Code:
    //******************
    using System;
    using System.IO;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using Microsoft.Win32;
    using MySql.Data.MySqlClient;
    using System.Runtime.InteropServices;
    using System.Threading;
    using System.Data.OleDb;
    //************************
    
    
    string conString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source="+folderPath+";Extended Properties=dBase IV";
                    OleDbConnection conn = new OleDbConnection(conString);
                    OleDbCommand cmd = conn.CreateCommand();
                    OleDbDataReader rdr;
                    cmd.CommandText = "SELECT * FROM UF01J1RU.dbf";
                    conn.Open();
                    rdr = cmd.ExecuteReader(CommandBehavior.SequentialAccess);
    Last edited by Arc; Jul 10th, 2007 at 02:27 AM.
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


Posting Permissions

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



Click Here to Expand Forum to Full Width