title: How to write binary data into csv file?
body: <p>I have a table <strong>StaffMaster</strong> which is containing <strong>staff photograph</strong> and the datatype of that table is <strong>varbinary</strong>. so, i want to export this table into csv file format using c# code. Even i have tried to export that table manually by sql server export task. But it shows following error.</p>
  
  <pre><code>- Validating (Error)
  Messages
  Error 0xc0208030: Data Flow Task: The data type for "input column 
  "StaffPhoto" (376)" is DT_IMAGE, which is not supported. Use DT_TEXT 
  or DT_NTEXT instead and convert the data from, or to, DT_IMAGE using    
  the data conversion component.
   (SQL Server Import and Export Wizard)
  </code></pre>
  
  <p>I know the data are stored in binary(byte[]). But, I would like to know is it possible that can i convert it to string and when i want to import it to the sql server database it should be converted into binary. So, my data will not be lost. Image size can be 100 kb to 500 kb.</p>
  
  <p>I cannot store image outside of the csv file.</p>
  
  <p>I am using SQL Server 2005.</p>