title: Read data from Excel sheet from URL in C#
body: <p>I am trying to read data from excel sheet from a URL (ex:- <a href="https://example.com" rel="nofollow noreferrer">https://example.com</a>). This URL will download an excel sheet to local machine but my requirement is to read data without downloading the file to local machine. I tried using <code>StreamReader</code> but getting </p>
  
  <blockquote>
    <p><code>System.Net.WebException</code> (the connection was aborted) error at <code>reader.ReadToEnd()</code>.</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>public static void GetStream()
  {
      String strURL = String.Empty;
      strURL = "https://example.com";    
      HttpWebRequest request = (HttpWebRequest)WebRequest.Create(strURL);    
      StreamReader reader;    
      using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
      {
          reader = new StreamReader(response.GetResponseStream());
      }
      var en = reader.CurrentEncoding; //System.Text.UTF8Encoding    
      string val = reader.ReadToEnd();               
  }
  </code></pre>