title: How can I programmatically get Approval Status in SharePoint?
body: <p>I wanted to programmatically get SharePoint Page Approval Status, I tried as below</p>
  
  <p>public string GetApprovalStatus(string url, string listName, string fileref)
          {
              string result = string.Empty;
              string caml = @"
                                
                                  
                                  " + fileref + @"
                                
                             ";</p>
  
  <pre><code>        using (SPSite site = new SPSite(url))
          {
              using (SPWeb web = site.OpenWeb())
              {
                  SPList list = web.Lists[listName];
                  SPQuery query = new SPQuery();
                  query.Query = caml;
  
                  SPListItemCollection myItems = list.GetItems(query);
  
                  if (myItems != null &amp;&amp; myItems.Count &gt; 0)
                  {
                      DataTable dt = myItems.GetDataTable();
                      result = dt.Rows[0]["_ModerationStatus"].ToString();
                      dt.Dispose();
                  }
              }
          }
          return result;
      }
  </code></pre>
  
  <p>And I return a number, how can I get the Approval Status in text?</p>
  
  <p>Appreciate any help, thank you in advanced</p>