title: How to Read Review Status,Comments,Modified By Columns of FileCollection Using Microsoft.Sharepoint.Client.dll
body: <p>How to read all columns of a File using Microsoft.Sharepoint.Client.dll.</p>
  
  <p>Actually my documents resides into sub folders so i am using ExecuteQuery() and once i am reaching to the specified documents folder then loading all the files into filecollection of that folder in to Context and then trying to read the columns of the webpage along with the excel file name. </p>
  
  <p><img src="https://i.stack.imgur.com/pDexE.jpg" alt="enter image description here"></p>
  
  <p>In the above Image you can find the Yellow highligted columns.I want to read those columns from c#.
  Below is the code which i had written:-</p>
  
  <pre><code>            string siteUrl = @"http://localhost";
          ClientContext clientContext = new ClientContext(siteUrl);
          clientContext.Credentials = new NetworkCredential("*****", "*****", "*****");
          Web site = clientContext.Web;
          FolderCollection SearchFolder = site.Folders;
          clientContext.Load(SearchFolder);
          clientContext.ExecuteQuery();
          //Iterating each folder inside the website
          foreach (Folder searchFolder in SearchFolder)
              {
              if (searchFolder.Name == "Random Scan Tracking")
                  {
                  //Displays and Logs Message
                  _loggerDetails.LogMessage = "Search Folder : " + searchFolder.Name;
                  _writeLog.LogDetails(_loggerDetails.LogLevel_Info, _loggerDetails.LogMessage);
  
                  Console.WriteLine("Search Folder : " + searchFolder.Name);
                  FolderCollection RegionFolder=searchFolder.Folders;
                  clientContext.Load(RegionFolder);
                  clientContext.ExecuteQuery();
                  //Iterating each Region Folder inside the Random Scan Folder
                  foreach (Folder regionFolder in RegionFolder)
                      {
                      Console.WriteLine("Region Folder : " + regionFolder.Name);
                      //Displays and Logs Message
                      _loggerDetails.LogMessage = "Region Folder : " + regionFolder.Name;
                      _writeLog.LogDetails(_loggerDetails.LogLevel_Info, _loggerDetails.LogMessage);
  
                      FolderCollection StateFOlder=regionFolder.Folders;
                      clientContext.Load(StateFOlder);
                      clientContext.ExecuteQuery();
                      //Iterating each State Folder inside the Region Folder
                      foreach (Folder stateFolder in StateFOlder)
                          {
                          Console.WriteLine("State Folder : " + stateFolder.Name);
                          //Displays and Logs Message
                          _loggerDetails.LogMessage = "State Folder : " + stateFolder.Name;
                          _writeLog.LogDetails(_loggerDetails.LogLevel_Info, _loggerDetails.LogMessage);
  
                          FolderCollection CountyFolder=stateFolder.Folders;
                          clientContext.Load(CountyFolder);
                          clientContext.ExecuteQuery();
                          //Iterating each County Folder inside the State Folder
                          foreach (Folder countyFolder in CountyFolder)
                              {
                              Console.WriteLine("County Folder : " + countyFolder.Name);
                              //Displays and Logs Message
                              _loggerDetails.LogMessage = "County Folder : " + countyFolder.Name;
                              _writeLog.LogDetails(_loggerDetails.LogLevel_Info, _loggerDetails.LogMessage);
  
                              FolderCollection MonthFolder=countyFolder.Folders;
                              clientContext.Load(MonthFolder);
                              clientContext.ExecuteQuery();
                              //Iterating each Month Folder inside the County Folder
                              foreach (Folder monthFolder in MonthFolder)
                                  {
                                  Console.WriteLine("Month Folder : " + monthFolder.Name);
                                  //Displays and Logs Message
                                  _loggerDetails.LogMessage = "Month Folder : " + monthFolder.Name;
                                  _writeLog.LogDetails(_loggerDetails.LogLevel_Info, _loggerDetails.LogMessage);
  
                                  FileCollection flc=monthFolder.Files;
                                  clientContext.Load(flc);
                                  clientContext.ExecuteQuery();
                                  foreach (Microsoft.SharePoint.Client.File file in flc)
                                      {
                                      Console.WriteLine("File Name : " + file.Name);
                                      Console.WriteLine("File Check out By Name : " + file.CheckedOutByUser.ToString());
                                      Console.WriteLine("FileCheck in Comment : " + file.CheckInComment.ToString());
                                      Console.WriteLine("Modified ByComment : " + file.ModifiedBy.ToString());
                                      Console.WriteLine("Modified Date : " + file.TimeLastModified.ToString());
                                      Console.WriteLine("Created Date : " + file.TimeCreated.ToString());
                                      //Displays and Logs Message
                                      _loggerDetails.LogMessage = "File Name : " + file.Name;
                                      _writeLog.LogDetails(_loggerDetails.LogLevel_Info, _loggerDetails.LogMessage);
                                      //Displays and Logs Message
                                      _loggerDetails.LogMessage = "File Check out By Name : " + file.CheckedOutByUser.ToString();
                                      _writeLog.LogDetails(_loggerDetails.LogLevel_Info, _loggerDetails.LogMessage);
                                      //Displays and Logs Message
                                      _loggerDetails.LogMessage = "FileCheck in Comment : " + file.CheckInComment.ToString();
                                      _writeLog.LogDetails(_loggerDetails.LogLevel_Info, _loggerDetails.LogMessage);
                                      //Displays and Logs Message
                                      _loggerDetails.LogMessage = "Modified ByComment : " + file.ModifiedBy.ToString();
                                      _writeLog.LogDetails(_loggerDetails.LogLevel_Info, _loggerDetails.LogMessage);
                                      //Displays and Logs Message
                                      _loggerDetails.LogMessage = "Modified Date : " + file.TimeLastModified.ToString();
                                      _writeLog.LogDetails(_loggerDetails.LogLevel_Info, _loggerDetails.LogMessage);
                                      //Displays and Logs Message
                                      _loggerDetails.LogMessage = "Created Date : " + file.TimeCreated.ToString();
                                      _writeLog.LogDetails(_loggerDetails.LogLevel_Info, _loggerDetails.LogMessage);
                                      }
                                  }
                              }
                          }
                      }
                  }
              }
  </code></pre>
  
  <p>I am able to read the filename, modified by of each file but i want to read the Modified Date, Review Status, Comments and Checked out to columns also.</p>