title: Linq Query using where clause in windows phone app
body: <p>I have a query that should return a 5 rows from a where clause using linq2xml in windows phone   app the query i try is </p>
  
  <pre><code>XDocument loadedCustomData = XDocument.Load("pincodes.xml");`
  
  var filteredData = from c in loadedCustomData.Descendants("record")`
  
                 where c.Attribute("PON").Equals ("Adapur")`
                   select new pincodes1()
  {
     PON = c.Attribute("PostOfficeName").Value,
     PIN = c.Attribute("Pincode").Value,
     DIS = c.Attribute("Districts").Value,
     CT = c.Attribute("City").Value,
     ST = c.Attribute("State").Value
  };
  listBox1.ItemsSource = filteredData;
  </code></pre>
  
  <p>but then it gives system Null Exception so what's wrong in query 
  here is the screenshot
  <img src="https://i.stack.imgur.com/m8dPC.jpg" alt="here it is where i get error(exception)"></p>
  
  <p>and this is class file</p>
  
  <pre><code>namespace pincodes
  {
     class pincodes1
      {
  
          string PostOfficeName;
          string Pincode;
          string Districts;
          string City;
          string State;
          public string PON
          {
              get { return PostOfficeName; }
              set { PostOfficeName = value; }
          }
          public string PIN
          {
              get { return Pincode; }
              set { Pincode = value; }
          }
          public string DIS
          {
              get { return Districts; }
              set { Districts = value; }
          }
          public string CT
          {
              get { return City; }
              set { City = value; }
          }
          public string ST
          {
              get { return State; }
              set { State = value; }
          } 
      }
  }
  </code></pre>
  
  <p>So what is the reason for System Null exception in the  LINQ Query </p>