G
Guest
Hi,
I have a windows form with a button and a richtext box
On click of a button ,I am looping through a datatable which has 3600 rows
and i am checking some code for each column in the row.There are 300
columns.
So total iteraations are 3600*300=960000
eg
for(i=0;i<rows.count;i++){
//get a datarow
for(j=0;j<rows.columns.count;j++)
{
if(datarow[j]=xyz) {
//some code
//write to textbox on windows form
}
}
//write row details to textbox
}
I am calling this code in the btn_click event.
My problem is that after I click the button my UI seems to hang and nothing
is shown on the textbox til all processing is over.When I run the code for
only 2 rows I get the output on the textbox fast but again after it has
finished processing the 2 rows.
My qn is how to make the code write to the UI after it has finished
prcessing one row?I know I need to use multi threading but I am a newbie and
pretty much confused about it.
I am using Visual studio 2003 and C# 1.x
Pls help.
Thanks in advance.
I have a windows form with a button and a richtext box
On click of a button ,I am looping through a datatable which has 3600 rows
and i am checking some code for each column in the row.There are 300
columns.
So total iteraations are 3600*300=960000
eg
for(i=0;i<rows.count;i++){
//get a datarow
for(j=0;j<rows.columns.count;j++)
{
if(datarow[j]=xyz) {
//some code
//write to textbox on windows form
}
}
//write row details to textbox
}
I am calling this code in the btn_click event.
My problem is that after I click the button my UI seems to hang and nothing
is shown on the textbox til all processing is over.When I run the code for
only 2 rows I get the output on the textbox fast but again after it has
finished processing the 2 rows.
My qn is how to make the code write to the UI after it has finished
prcessing one row?I know I need to use multi threading but I am a newbie and
pretty much confused about it.
I am using Visual studio 2003 and C# 1.x
Pls help.
Thanks in advance.