title: C# - Attach file saved in database to an email
body: <p>How can I add one or more files that are saved in a MS SQL database to an email? I already know how to attach files saved in a directory or from a fileUpload control.</p>
  
  <p>My datable fields are as such:</p>
  
  <p>col1: Email_ID - int</p>
  
  <p>col2: file_name - varchar</p>
  
  <p>col3: file_content - image</p>
  
  <p>So my SQL select statement is prety simple: </p>
  
  <pre><code>Select file_name, file_content from Attachments where Email_ID = 333
  </code></pre>
  
  <p>I just can't figure how to attach them to my emails afterwards.</p>
  
  <p>Thanks!</p>