Solved

DBF to txt file

Posted on 2011-09-07
5
1,317 Views
Last Modified: 2012-05-12
Can someone show me some code that converts DBF to flat text file.
0
Comment
Question by:conceptdata
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 12

Accepted Solution

by:
rajapandian_81 earned 250 total points
ID: 36495519
0
 

Author Comment

by:conceptdata
ID: 36497408
Thanks.
But Ihave a little errors in the "DBF file to dataset" code.

I converted i to C#, and it looks like attached code .

But I am getting a lot of errors in the code.
Can you help - Thanks

using Microsoft.VisualBasic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Data.OleDb;

public class Form1
{

    private string constringSource = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\\LH\\CENSHLD2;Extended Properties=dBASE IV;";
    private OleDbConnection conSource = new OleDbConnection(constringSource);
    private string sqlSource = "SELECT * FROM CENSUSES.DBF";
    private OleDbDataAdapter daSource = new OleDbDataAdapter(sqlSource, conSource);

    private DataTable dtSource = new DataTable("SourceTable");
    private void Form1_Load(object sender, System.EventArgs e)
    {
        string msg = "";
        long ticks = DateAndTime.Now.Ticks;
        daSource.Fill(dtSource);
        msg = (DateAndTime.Now.Ticks - ticks) / TimeSpan.TicksPerMillisecond + " milliseconds to read " + dtSource.Rows.Count + " rows of " + dtSource.Columns.Count + " fields";
        Interaction.MsgBox(msg);
    }
    public Form1()
    {
        Load += Form1_Load;
    }
}

Open in new window

0
 

Author Comment

by:conceptdata
ID: 36497612
Hi Again ..

I have solved it myself, I think .. :)
0
 
LVL 12

Expert Comment

by:rajapandian_81
ID: 36500432
Are you able to convert DBF to flat text file?
0
 

Author Comment

by:conceptdata
ID: 36521018
Yes - Thanks.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question