title: How do I use System.Net.ConnectStream?
body: <p>I am trying to get my head around some of my predecessors code who, helpfully, has used 'var' to declare everything.</p>
  
  <p>I have a using statement which is below:</p>
  
  <pre><code>using (var postStream = request.GetRequestStream())
  {
      postStream.Write(byteData, 0, byteData.Length);
  }
  </code></pre>
  
  <p>When I put a breakpoint here, postStream shows up in the Autos window as System.Net.ConnectStream. Instead of 'var' I want to use 'ConnectStream' but the compiler doesn't like this.</p>
  
  <p>What am I missing, why can't I write my code like this:</p>
  
  <pre><code>using (ConnectStream postStream = request.GetRequestStream())
  {
      postStream.Write(byteData, 0, byteData.Length);
  }
  </code></pre>
  
  <p>I know this is trivial but I was always taught not to use 'var' unless you have a specific reason to do so (such as when dealing with LINQ). Am I wrong?</p>