views:

87

answers:

1

I'm asking that because I created a windows service and it seem that under heavy load(which in my case when windows is booting up) the data inside the xml doesn't get loaded before I manually do stuff with it in my case is checking how many row are in a specific datatable inside that dataset.

dataset got a schema.

speudo code would be:

dataset.readxml("c:\myfile.xml")
if dataset.datatable1.rowcount is 1 
    do something
else
    do something else

in my case, it reach the else case even if there is one row.

if I start the service manually after, because the else case stop it, everything work fine.

edit

if it's synchronous, what could cause that behavior?

+3  A: 

Asynchronous methods in the .NET classes follows the the BeginSomeAction() / EndSomeAction() pattern, so my guess is that ReadXml() is synchronous. According to the documentation there's no BeginReadXml for DataSet.

EDIT: A quick browse through the implementation indicates a synchronous read, so unless there's something I have missed it supports my guess.

Brian Rasmussen