Click here to Skip to main content
16,016,489 members
Home / Discussions / C#
   

C#

 
AnswerRe: passing parameter from one windows form to another one Pin
Christian Graus5-Aug-07 14:55
protectorChristian Graus5-Aug-07 14:55 
QuestionThreading passing parameters to thread Pin
Muhammad Nauman Yousuf5-Aug-07 12:29
Muhammad Nauman Yousuf5-Aug-07 12:29 
AnswerRe: Threading passing parameters to thread Pin
Luc Pattyn5-Aug-07 13:15
sitebuilderLuc Pattyn5-Aug-07 13:15 
GeneralRe: Threading passing parameters to thread Pin
Muhammad Nauman Yousuf6-Aug-07 8:10
Muhammad Nauman Yousuf6-Aug-07 8:10 
AnswerRe: Threading passing parameters to thread Pin
justintimberlake5-Aug-07 17:52
justintimberlake5-Aug-07 17:52 
QuestionHow to load data from database using threading and progressbar Pin
vkuttyp5-Aug-07 8:48
professionalvkuttyp5-Aug-07 8:48 
AnswerRe: How to load data from database using threading and progressbar Pin
Luc Pattyn5-Aug-07 8:56
sitebuilderLuc Pattyn5-Aug-07 8:56 
GeneralRe: How to load data from database using threading and progressbar Pin
vkuttyp6-Aug-07 1:28
professionalvkuttyp6-Aug-07 1:28 
I found a solution during my googling. But it is not working in my case, can any body please check this code.
this what I found:
public partial class Form1 : Form
{
public static string ConnectionString = "" //your connection string here
DataSet DS = new DataSet();
double TotalRows =0;
double RowIndex = 1;
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{

OleDbConnection DBConn = new OleDbConnection(ConnectionString);
OleDbDataAdapter DBAdapter = new OleDbDataAdapter();
DBAdapter.SelectCommand = new OleDbCommand("SELECT Count(*) from tblPersons", DBConn);
DBConn.Open();
TotalRows = (int)DBAdapter.SelectCommand.ExecuteScalar(); //retrieve the nr. of rows in the DB Table
DBConn.Close();
DBAdapter.SelectCommand.CommandText = "SELECT * from tblPersons";
DS.Tables.Add(new DataTable("Customers"));

// Add event handler to the row changing event in the dataset

DS.Tables["Customers"].RowChanging += new DataRowChangeEventHandler(Form1_RowChanging);
DBAdapter.Fill(DS, "Customers");
dataGridView1.DataSource = DS.Tables[0];
}

void Form1_RowChanging(object sender, DataRowChangeEventArgs e)
{
if (e.Action.ToString() == "Add") //check if the action is 'Add' (not 'Commit')
{
Thread.Sleep(500);
progressBar1.Value = (int)Math.Round((double)(RowIndex / TotalRows) * 100); //update the progressbar
progressBar1.Refresh();
RowIndex++; //count rows
}
}

}
}


Kutty

QuestionPleas give me Your help Pin
Thaer Hamael5-Aug-07 8:30
Thaer Hamael5-Aug-07 8:30 
AnswerRe: Pleas give me Your help Pin
Malcolm Smart5-Aug-07 11:26
Malcolm Smart5-Aug-07 11:26 
Questionwindows service set up issue Pin
sujithapril5-Aug-07 8:13
sujithapril5-Aug-07 8:13 
AnswerRe: windows service set up issue Pin
PaulPrice5-Aug-07 21:26
PaulPrice5-Aug-07 21:26 
GeneralRe: windows service set up issue Pin
sujithapril6-Aug-07 7:15
sujithapril6-Aug-07 7:15 
GeneralRe: windows service set up issue Pin
PaulPrice6-Aug-07 21:43
PaulPrice6-Aug-07 21:43 
QuestionPlace form 10px from right side of screen. Pin
jafingi5-Aug-07 7:46
jafingi5-Aug-07 7:46 
AnswerRe: Place form 10px from right side of screen. Pin
Hessam Jalali5-Aug-07 8:58
Hessam Jalali5-Aug-07 8:58 
AnswerRe: Place form 10px from right side of screen. Pin
Luc Pattyn5-Aug-07 8:59
sitebuilderLuc Pattyn5-Aug-07 8:59 
AnswerRe: Place form 10px from right side of screen. Pin
jafingi5-Aug-07 9:38
jafingi5-Aug-07 9:38 
QuestionAsymetric Cryptography Problem Pin
unforgiven_wild_rose5-Aug-07 5:11
unforgiven_wild_rose5-Aug-07 5:11 
AnswerRe: Asymetric Cryptography Problem Pin
Hessam Jalali5-Aug-07 6:27
Hessam Jalali5-Aug-07 6:27 
GeneralRe: Asymetric Cryptography Problem Pin
unforgiven_wild_rose5-Aug-07 20:50
unforgiven_wild_rose5-Aug-07 20:50 
GeneralRe: Asymetric Cryptography Problem Pin
Hessam Jalali6-Aug-07 1:02
Hessam Jalali6-Aug-07 1:02 
GeneralRe: Asymetric Cryptography Problem Pin
unforgiven_wild_rose6-Aug-07 23:52
unforgiven_wild_rose6-Aug-07 23:52 
QuestionComboBox In DataGridView Pin
Thaer Hamael5-Aug-07 4:21
Thaer Hamael5-Aug-07 4:21 
QuestionTry to use C# code in C++ code as com instance ... Pin
Yanshof5-Aug-07 1:56
Yanshof5-Aug-07 1:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.