J
James Morton
I have a Static DataSet in a class file that I am using globally between a
few forms. The main form populates the dataset through a menu option which
invokes ReadXML in the class file to populate the DataSet. The ReadXML is a
rather lengthy operation with >5mb xml files (I am reading in the schema and
ignoreschema on read). This has presented several problems
1) What kind of progress bar can I show during load since I can't increment
while ReadXML is reading the xml file, do I have to override the base class
for read xml or is their a simpler way, the progress bar wouldn't have to be
exact?
2) I am thinking I need to start a seperate thread from the main form
calling the CreateDataSetFromXML in my class file. I don't know alot about
threading and right now the delegate works to call the createDataSet but
does not sync correctly to bind the datagrid on the main form. It basically
leads me to ask how can I struture serial operations within a thread. Also
how can I fire an event from a thread once a particular part (the ReadXML)
has finished, so I could, for instance, stop the progress bar.
3) I am fairly new to windows forms and am looking for a good tutorial on
how I can have a seperate form with a progress bar have the front focus and
recieve msg's from functions in other class/form files and put the
application into a "wait" state until the processing is finished so I
prevent "application not responding".
Anyways I know this is probably alot of info, and I can find alot of this on
the web but I need a really good functional overview, i.e. I feel like I
have a big puzzle , most of the pieces, but no finished picture to work
from. I'll post whatever samples from the code you would like to see.
few forms. The main form populates the dataset through a menu option which
invokes ReadXML in the class file to populate the DataSet. The ReadXML is a
rather lengthy operation with >5mb xml files (I am reading in the schema and
ignoreschema on read). This has presented several problems
1) What kind of progress bar can I show during load since I can't increment
while ReadXML is reading the xml file, do I have to override the base class
for read xml or is their a simpler way, the progress bar wouldn't have to be
exact?
2) I am thinking I need to start a seperate thread from the main form
calling the CreateDataSetFromXML in my class file. I don't know alot about
threading and right now the delegate works to call the createDataSet but
does not sync correctly to bind the datagrid on the main form. It basically
leads me to ask how can I struture serial operations within a thread. Also
how can I fire an event from a thread once a particular part (the ReadXML)
has finished, so I could, for instance, stop the progress bar.
3) I am fairly new to windows forms and am looking for a good tutorial on
how I can have a seperate form with a progress bar have the front focus and
recieve msg's from functions in other class/form files and put the
application into a "wait" state until the processing is finished so I
prevent "application not responding".
Anyways I know this is probably alot of info, and I can find alot of this on
the web but I need a really good functional overview, i.e. I feel like I
have a big puzzle , most of the pieces, but no finished picture to work
from. I'll post whatever samples from the code you would like to see.