title: how to filter a list on SharePoint
body: <p>I am using SharePiont Server 2007 Enterprise with Windows Server 2008 Enterprise, and I am using publishing portal template. I am developing using VSTS 2008 + C# + .Net 3.5. I have defined a custom list manully on a SharePoint site (all column types of the custom list are SharePoint built-in types), and I want to define some customized rules to filter this list to display only a part of the list. Any reference code?</p>
  
  <p>EDIT1: Here is my current code. I have used such code to retrieved the items I need, but how to display the retieved items in a SharePoint list?</p>
  
  <pre><code>SPSite oSiteCollection = SPContext.Current.Site;
  SPList oList = oSiteCollection.AllWebs[0].Lists["PeopleTest"];
  SPQuery oQuery = new SPQuery();
  oQuery.Query = "&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name='Department'/&gt;" +
                 "&lt;Value Type='Text'&gt;Computer&lt;/Value&gt;&lt;/Eq&gt;&lt;/Where&gt;";
  SPListItemCollection collListItems = oList.GetItems(oQuery);
  
  foreach (SPListItem oListItem in collListItems)
  {
      writer.Write(oListItem["Department"].ToString()+"###");
  } 
  </code></pre>