Solved

DBF to txt file

Posted on 2011-09-07
5
1,370 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

Industry Leaders: 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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…

688 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