title: deserialize an XML object returned from SQL query?
body: <p>I need to deserialize an XML object that 'should' be returned from a SQL query.</p>
  
  <p>I had this working in JSON, but cannot use JSON so I am moving over to XML. The JsonConvert functionality gets my result in one line.. but I am not really sure how to handle what SQL gives me.</p>
  
  <p>When writing to the server the Table is getting an Xdocument type, into a xml datatype cell.</p>
  
  <pre><code>        if (do_sql_read)
          {
              List&lt;string&gt; usernames = new List&lt;string&gt;();
              List&lt;int&gt; ids = new List&lt;int&gt;();
              string sql_load;
  
              Player player_after_load = new Player();
  
              //multiple
              string select_string = @"SELECT * FROM [Table]";
  
              using (SqlConnection sql_connection_a = new SqlConnection( GetConnectionString() ) )
              {
                  sql_connection_a.Open();
  
                  using (SqlCommand command = new SqlCommand(select_string, sql_connection_a))
                  {
                      SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default);
  
                      // XML VERSION
                      while (reader.Read())
                      {
                          int iii = reader.GetInt32(0);    // unique id int
                          string name = reader.GetString(1);  // Name string
                          sql_load = reader.GetString(2);
                          usernames.Add(name);
                          ids.Add(iii);
  
                          XmlSerializer XML_serializer = new XmlSerializer (typeof(Player));
  
  
                          // &lt;&lt;&lt;&lt;&lt; THIS PART ??? &gt;&gt;&gt;
                          player_after_load = (Player)XML_serializer.Deserialize (sql_load);
  
                          Console.WriteLine("SQLPlayer:  " + iii + " " + player_after_load.name + " " + player_after_load.health + " " + player_after_load.mana);
                      }
  
  
                      /* JSON VERSION WORKS
                      while (reader.Read())
                      {
                          int iii = reader.GetInt32(0);    // unique id int
                          string name = reader.GetString(1);  // Name string
                          sql_load = reader.GetString(2);
                          usernames.Add(name);
                          ids.Add(iii);
  
                          player_after_load = JsonConvert.DeserializeObject&lt;Player&gt;(sql_load);
                          Console.WriteLine("SQLPlayer:  " + iii + " " + player_after_load.name + " " + player_after_load.health + " " + player_after_load.mana);
                      }
                      */
                  }
              }
  
          } // end do_sql_string
  </code></pre>