你的代码咋个写的哦The following example creates a SqlCommand and then executes it using ExecuteXmlReader. The example is passed a string that is a Transact-SQL FOR XML SELECT statement, and a string to use to connect to the data source.public void CreateMyXmlReader(string myXmlQuery, SqlConnection myConnection) 
 {
    SqlCommand myCommand = new SqlCommand(myXmlQuery, myConnection);
    try
    {
     myConnection.Open();     System.Xml.XmlReader myXmlReader = myCommand.ExecuteXmlReader();     // Always close the XmlReader when finished.
     myXmlReader.Close();
    }
    catch(Exception e)
    {
      System.Diagnostics.EventLog log = new System.Diagnostics.EventLog();
      log.Source = "My Application";
      log.WriteEntry(e.ToString());
      Console.WriteLine("Exception of type {0} occurred.", e.GetType());
    }
    finally
    {
      myConnection.Close();
    }
 }