title: Convert varbinary back to .txt file
body: <p>I have a database (SQL 2008) where I store file's in.
  These are saved as a varbinary(max) type.</p>
  
  <p>Now I need to get the .txt file again so I can loop through the contents of the file like i used to do with StreamReader.</p>
  
  <pre><code>while ((line = file.ReadLine()) != null)
  {
  string code = line.Substring(line.Length - 12);
  }
  </code></pre>
  
  <p>But how can I convert the varbinary byte[] back to the normal .txt file so I'm able to go through the contents line by line.</p>
  
  <p>I found some ideas with memorystream or filestream but can't get them to work.</p>
  
  <p>Thanks in advance!</p>