Click here to Skip to main content
15,899,825 members
Home / Discussions / C#
   

C#

 
Questiondatagridvew Pin
Sonia Gupta5-Aug-07 18:18
Sonia Gupta5-Aug-07 18:18 
QuestionRe: datagridvew Pin
T.EDY5-Aug-07 18:31
T.EDY5-Aug-07 18:31 
AnswerRe: datagridvew Pin
Sonia Gupta5-Aug-07 18:47
Sonia Gupta5-Aug-07 18:47 
AnswerRe: datagridvew Pin
Brady Kelly5-Aug-07 23:25
Brady Kelly5-Aug-07 23:25 
Questionregistering COM component as Out proc sever Pin
KrunalC5-Aug-07 17:44
KrunalC5-Aug-07 17:44 
AnswerRe: registering COM component as Out proc sever Pin
KrunalC5-Aug-07 19:50
KrunalC5-Aug-07 19:50 
GeneralRe: registering COM component as Out proc sever Pin
Dave Kreskowiak6-Aug-07 4:12
mveDave Kreskowiak6-Aug-07 4:12 
QuestionChecking last index of the array giving me a problem. VS2005 C# Pin
foolios5-Aug-07 16:47
foolios5-Aug-07 16:47 
AnswerRe: Checking last index of the array giving me a problem. VS2005 C# Pin
Hessam Jalali5-Aug-07 19:25
Hessam Jalali5-Aug-07 19:25 
Questionpassing parameter from one windows form to another one Pin
dinakatina5-Aug-07 14:47
dinakatina5-Aug-07 14:47 
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 

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.