Updated the CsvFileTester for Jet 4.0

I was playing around building a tool to let me edit a database table in Excel, so I updated my CvsFileTester project to work in a modern world, including the 32-bit only Jet 4.0 driver you've probably go lying around on your HD.

Enjoy.



Comment Feed 7 comments on this post

Scott:


I didn't walk through all the details of your app, but isn't it easier to just use Log Parser Toolkit to directly query the CSV?

Monday, Apr 19, 2010, 7:01 AM


Chris Sells:


Do you mean the Log Parser here?

http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&displaylang=en

If so, I never heard of it 'til today. Does it do updates, too?

Monday, Apr 19, 2010, 8:13 PM


Scooter:


I don't believe it does updates, although I haven't used it in quite a while. SELECTS. But you can read (SELECT) into a new file (although depending on the amount of data you're dealing with and how much of it you want to manipualte, that might be more expensive). I used it for IIS logs, XML, and a variety of other things that I used to pull into SQL Server first. Works like a charm for about 95% of those use cases.

Tuesday, Apr 20, 2010, 5:56 PM


Santosh:


Could you pls post the connector string used by the tool?

Friday, Aug 6, 2010, 7:24 AM


Chris Sells:


Here's the relevant code:

static DataTable GetRowsFromCsvFile(string folder, string query) {
  string connString = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\"{0}\"; Extended Properties='text;HDR=Yes;FMT=Delimited(,)';", folder);
  using (var conn = new OleDbConnection(connString)) {
    using (OleDbCommand cmd = new OleDbCommand(query, conn)) {
      conn.Open();
      using (OleDbDataAdapter adp = new OleDbDataAdapter(cmd)) {
        DataTable table = new DataTable();
        adp.Fill(table);
        return table;
      }
    }
  }
}

Sunday, Aug 8, 2010, 2:51 PM


Santosh:


Thanks Chris. Iam using the following connection string in an xml file but get the error Keyword 'provider' not found. What am I doing wrong?

<Import Name="StructureUSDownstate" ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\ManageSoft\Imports\HR Import;Extended Properties=&quot;text;HDR=Yes;FMT=Delimited&quot;;Persist Security Info=False" Query="select * from [NGUS_Downstate#csv]">

Monday, Aug 9, 2010, 6:45 AM


Chris Sells:


Santosh, can you email me a minimal, domain-neutral project that repro's the error? csells@sellsbrothers.com

Tuesday, Aug 10, 2010, 12:54 PM





comment on this post

HTML tags will be escaped.

Powered By ASP.NET

Hosted by SecureWebs

Microsoft

Mensa

IEEE


moving companies
addiction treatment
sunglasses
Kratom
How To Lose Weight Fast
cocktail dresses
Credit Card Balance Transfer
Add URL
Stock Trading
International Air Charter
Promotional Merchandise
Jet Privé
loans for bad credit
Forex Broker