Solved

DBF to txt file

Posted on 2011-09-07
5
1,232 Views
Last Modified: 2012-05-12
Can someone show me some code that converts DBF to flat text file.
0
Comment
Question by:conceptdata
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

920 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now