How to use XmlDataProvider from code behind (c# code)

Posted by SunKwon Kim on 2009/03/07 23:19
Filed under WPF
Tags : , ,

In many cases, XML is very useful in programming

For example, I have written a program which support many product catalogs. In traditional programming, we had used a database or a customized file which support hierarchy structures. But in recent day, we can easily do that by XML. In WPF, XmlDataProvider was given to us to handle XML data.

how to use XMLDataProvider from code behind (c# code)

It was not problem when I use XmlDataProvider in xaml. The problem occurs when I use XmlDataProvider in code behind (C# code)!. I wrote the code like this

But dp.Document has null! And After running it twice, dp.Document has data I wants. It looks very strange to me. If you have same problem, don't worry about it. The key to solve this situation is following.
After changing "IsAsynchronous" property to false, XmlDataProvider will give you all the results you order.

2009/03/07 23:19 2009/03/07 23:19
Trackback URL >> http://crowsley2.cafe24.com/trackback/27
  1. ainqczqz

    Tracked from ainqczqz 2009/10/20 10:43  delete
    ainqczqz
  2. fezmcdfv

    Tracked from fezmcdfv 2009/10/20 12:03  delete
    fezmcdfv
Leave a comment
[Log-ing][What is OpenID?]