title: Display Image from Mysql Database is slow how would i increase the load speed? asynchronous
body: <p>Hello I'm doing a school project i have a page with images and I'm retrieving it form a MySQL Database however it is slow any way to increase the Image rendering?</p>
  
  <p>any help would be great :)</p>
  
  <p>My Code</p>
  
  <pre><code>&lt;asp:DataList ID="dlst" runat="server" DataKeyField="ProductID"  DataSourceID="SqlDataSource1" RepeatDirection="Horizontal" RepeatColumns="3" &gt;
          &lt;HeaderTemplate&gt;
  
          &lt;/HeaderTemplate&gt;
  
          &lt;ItemTemplate&gt;
              &lt;asp:ImageButton ID="btnpopup" runat="server" ImageUrl='&lt;%# "GetImage.aspx?id=" + Eval("ProductID") %&gt;' Width="200px" Height="200px" CommandArgument='&lt;%#Eval("ProductID") %&gt;' CommandName="popup"   CausesValidation="false" BorderStyle="Dotted" BorderColor="WhiteSmoke" /&gt;
  
  
          &lt;/ItemTemplate&gt;
  
          &lt;/asp:DataList&gt;
          &lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" 
              ConnectionString="&lt;%$ ConnectionStrings:smokeshopConnectionString %&gt;" 
              ProviderName="&lt;%$ ConnectionStrings:smokeshopConnectionString.ProviderName %&gt;" 
              SelectCommand="SELECT ProductID, Name, Description, ProductImage FROM products"&gt;&lt;/asp:SqlDataSource&gt;
  </code></pre>
  
  <p>My Second page Called GetImage</p>
  
  <pre><code>string id = Request.QueryString["id"];
  
          MySqlDataReader r = db.getImage(id);
  
          while(r.Read())
          {
              byte[] imgData = (byte[])r["ProductImage"];
              Response.BinaryWrite(imgData);
              Response.Flush();
          }
  </code></pre>