0

私はWindowsサービスを作成しましたが、負荷が高い場合(私の場合はWindowsが起動しているとき)、手動で何かを行う前にxml内のデータが読み込まれないようです。そのデータセット内の特定のデータテーブルにある行の数を確認します。

データセットはスキーマを取得しました。

疑似コードは次のようになります。

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

私の場合、1行でもelseの場合になります。

後で手動でサービスを開始すると、それ以外の場合はサービスが停止するため、すべてが正常に機能します。


同期している場合、何がその動作を引き起こす可能性がありますか?

4

1 に答える 1

3

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.

于 2009-03-26T12:12:31.103 に答える