title: populate list with images from database
body: <p>I want to retrieve the images from SQL table and save it in the list and show it in my listview. But I don't know how to do this. I need your help.</p>
  
  <p>I am using SQL Server 2008, Visual Studio 2008, C# Window Application.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>cmd = new SqlCommand("Select ScanImage from ScanDocuments", con);
  dr = cmd.ExecuteReader();
  
  List&lt;ImageList&gt; lstitem = new List&lt;ImageList&gt;();
  
  while (dr.Read())
  {
      ImageList _image = new ImageList();
      byte[] data = (byte[])dr["ScanImage"];
  
      MemoryStream ms = new MemoryStream(data);
      Image bmp = new Bitmap(ms);
  
      lstitem.Add(bmp);
  }
  </code></pre>