title: Load or convert varbinary from sql to textbox text?
body: <p>I'm new one in C# programming.<br>
  At present I try to save and load a text file to sql server. I watched and searched some videos and document on youtube. They stored image file to sql. I try and already saved the text file to server (binary data). Now I stuck how to load or convert it:</p>
  
  <p>When I save it, I used memorystream: </p>
  
  <pre><code>MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(textreview.Text);
  byte[] theBytes = Encoding.UTF8.GetBytes(textreview.Text);
  ms.Position = 0;
  ms.Read(theBytes, 0, theBytes.Length);
  
  //insert value to server
  SqlCommand cmdb = new SqlCommand("insert into Assignment(text) values (@text)", con);
  cmdb.Parameters.AddWithValue("@textname", textPathLabel.Text);
  cmdb.Parameters.AddWithValue("@text", theBytes);
  </code></pre>
  
  <p>Now I try to load it but I stuck here!</p>
  
  <pre><code>//load from sql
  byte[] picarr = (byte[])dr["text"];
  ms = new MemoryStream(picarr);
  ms.Seek(0, SeekOrigin.Begin);
  StreamReader reader = new StreamReader(ms);
  string text = reader.ReadToEnd();
  textreview.Text = text;
  </code></pre>