TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Zeb Rehman
NA
41
73k
Progress Bar
Dec 10 2011 6:56 AM
I want to insert a progress bar so that while reader don't complete reading data from database it progress toword it's completion. The code is given following
using System;
using System.Collections.Generic;
using System.Data.OleDb;
using System.IO;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ETL_Tool
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;data source=D:\\ptcl_1.accdb";
OleDbConnection conn = new OleDbConnection(connectionString);
string sql = "SELECT * FROM 51";
OleDbCommand cmd = new OleDbCommand(sql, conn);
conn.Open();
TextWriter tw = new StreamWriter("D:\\data.txt");
OleDbDataReader reader;
reader = cmd.ExecuteReader();
while (reader.Read())
{
//Some operation is performed here
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
}
}
Reply
Answers (
2
)
What a output of a this program
c#