Solved

DBF to txt file

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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 video discusses moving either the default database or any database to a new volume.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the fileā€¦

762 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

18 Experts available now in Live!

Get 1:1 Help Now