title: Not all code paths return a values
body: <p>I have written a function to find the the line by searching the text and after it find that particular line, I want to read the next line and return that text. The function is as follows:</p>
  
  <pre><code>public static string NextString(string textfind)
  {
      List&lt;string&gt; found = new List&lt;string&gt;();
      string linejd;
  
      using (StreamReader efile = new StreamReader(FILENAME))
      {
          int counter = 0;
          while ((linejd = efile.ReadLine()) != null)
          {
              counter++;
              if (linejd.Contains(textfind))
              {
                  found.Add(linejd);
                  string nextstring = efile.ReadLine();
                  return nextstring;
              }
          }
      }
  }
  </code></pre>
  
  <p>File name has been defined as: </p>
  
  <pre><code>const string FILENAME = @"E:\model\Yen and Lee\AQRun01\eratc.inp";
  </code></pre>
  
  <p>However, I keep on getting error:</p>
  
  <blockquote>
    <p>AQ.Program.NextString(string)': not all code paths return a value</p>
  </blockquote>