title: Reading line count using VB.NET
body: <p>How to calculate the number of rows in a file which we have uploaded. The file might be either a text file or a CSV or Excel file.</p>
  <p>I'm using the folowing code to get the record count like this:</p>
  <pre><code>Dim FileCount = From lin1 As String In File.ReadAllLines(hidFilePath.Value.ToString())
  Let dd = lin1.Count
  Select dd
  Dim file_count As Integer =  FileCount.Count
  </code></pre>
  <p>but in some cases the count is wrong.</p>