title: System.Byte[] shows in gridview instead of an image?
body: <p>Hi I have a page that allows me to upload photo. Then when i click upload...the photo has been approved. But when i want to display it in gridview. The column that the image must appear it gives me "System.Byte[]" instead of an image. Help :)</p>
  
  <p>Here's my code:</p>
  
  <pre><code>&lt;%@ Page Language="C#" Debug="true" %&gt;
  &lt;%@ Import Namespace="System" %&gt;
  &lt;%@ Import Namespace="System.Data" %&gt;
  &lt;%@ Import Namespace = "System.Data.SqlClient" %&gt;
  &lt;%@ Import Namespace= "System.Data.OleDb" %&gt;
  
  
  &lt;script runat="server" type="text/c#"&gt;
  protected void btnUpload_Click(object sender, EventArgs e)
  
  
  {
      {
     byte[] imageSize = new byte
                   [FileUpload1.PostedFile.ContentLength];
    HttpPostedFile uploadedImage = FileUpload1.PostedFile;
    uploadedImage.InputStream.Read
       (imageSize, 0, (int)FileUpload1.PostedFile.ContentLength);
   // Create SQL Connection 
    OleDbConnection con = new OleDbConnection();
    con.ConnectionString = ConfigurationManager.ConnectionStrings["recordsConnectionString"].ConnectionString;
   // Create SQL Command 
   OleDbCommand cmd = new OleDbCommand();
   cmd.CommandText = "INSERT INTO PendingRecords([Image])" + " VALUES (@Image)";
   cmd.CommandType = CommandType.Text;
   cmd.Connection = con;
  
   OleDbParameter UploadedImage = new OleDbParameter
                ("@Image", OleDbType.VarBinary, imageSize.Length);
  
   UploadedImage.Value = imageSize;
   cmd.Parameters.Add(UploadedImage);
   con.Open();
   cmd.ExecuteNonQuery();  
   GridView1.DataSourceID = "";
   GridView1.DataSource = SqlDataSource1;
   GridView1.DataBind();
   con.Close();
   }
  }
  &lt;/script&gt;
  
  &lt;form id="form1" runat="server"&gt;
  &lt;div&gt;
  &lt;asp:FileUpload ID="FileUpload1" runat="server"/&gt;
  &lt;asp:Label ID="lblMessage" runat="server"&gt;
  &lt;/asp:Label&gt;
  &lt;asp:Button ID="btnUpload" runat="server" 
              OnClick="btnUpload_Click" Text="Upload"/&gt;
  &lt;/div&gt;
  &lt;asp:GridView runat="server" id="GridView1" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" DataKeyNames="ID"&gt;
          &lt;Columns&gt;
              &lt;asp:boundfield DataField="ID" HeaderText="ID" ReadOnly="True" InsertVisible="False" SortExpression="ID"&gt;
              &lt;/asp:boundfield&gt;
              &lt;asp:boundfield DataField="Image" DataFormatString="{0}" HeaderText="Image" SortExpression="Image"&gt;
              &lt;/asp:boundfield&gt;
              &lt;asp:boundfield DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName"&gt;
              &lt;/asp:boundfield&gt;
          &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  &lt;asp:SqlDataSource runat="server" id="SqlDataSource1" ProviderName="&lt;%$ ConnectionStrings:recordsConnectionString.ProviderName %&gt;" ConnectionString="&lt;%$ ConnectionStrings:recordsConnectionString %&gt;" SelectCommand="SELECT * FROM [PendingRecords]" DeleteCommand="DELETE FROM [PendingRecords] WHERE [ID] = ?" InsertCommand="INSERT INTO [PendingRecords] ([Username], [Password], [FirstName], [LastName], [MiddleName], [Address], [Gender], [ContactNumber], [PlateNumber], [Color], [Brand], [LiscensedNumber]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" UpdateCommand="UPDATE [PendingRecords] SET [Username] = ?, [Password] = ?, [FirstName] = ?, [LastName] = ?, [MiddleName] = ?, [Address] = ?, [Gender] = ?, [ContactNumber] = ?, [PlateNumber] = ?, [Color] = ?, [Brand] = ?, [LiscensedNumber] = ? WHERE [ID] = ?"&gt;
      &lt;DeleteParameters&gt;
          &lt;asp:parameter Name="ID" Type="Int32" /&gt;
      &lt;/DeleteParameters&gt;
      &lt;UpdateParameters&gt;
          &lt;asp:parameter Name="Username" Type="String" /&gt;
          &lt;asp:parameter Name="Password" Type="String" /&gt;
          &lt;asp:parameter Name="FirstName" Type="String" /&gt;
          &lt;asp:parameter Name="LastName" Type="String" /&gt;
          &lt;asp:parameter Name="MiddleName" Type="String" /&gt;
          &lt;asp:parameter Name="Address" Type="String" /&gt;
          &lt;asp:parameter Name="Gender" Type="String" /&gt;
          &lt;asp:parameter Name="ContactNumber" Type="String" /&gt;
          &lt;asp:parameter Name="PlateNumber" Type="String" /&gt;
          &lt;asp:parameter Name="Color" Type="String" /&gt;
          &lt;asp:parameter Name="Brand" Type="String" /&gt;
          &lt;asp:parameter Name="LiscensedNumber" Type="String" /&gt;
          &lt;asp:parameter Name="ID" Type="Int32" /&gt;
      &lt;/UpdateParameters&gt;
      &lt;InsertParameters&gt;
          &lt;asp:parameter Name="Username" Type="String" /&gt;
          &lt;asp:parameter Name="Password" Type="String" /&gt;
          &lt;asp:parameter Name="FirstName" Type="String" /&gt;
          &lt;asp:parameter Name="LastName" Type="String" /&gt;
          &lt;asp:parameter Name="MiddleName" Type="String" /&gt;
          &lt;asp:parameter Name="Address" Type="String" /&gt;
          &lt;asp:parameter Name="Gender" Type="String" /&gt;
          &lt;asp:parameter Name="ContactNumber" Type="String" /&gt;
          &lt;asp:parameter Name="PlateNumber" Type="String" /&gt;
          &lt;asp:parameter Name="Color" Type="String" /&gt;
          &lt;asp:parameter Name="Brand" Type="String" /&gt;
          &lt;asp:parameter Name="LiscensedNumber" Type="String" /&gt;
      &lt;/InsertParameters&gt;
  &lt;/asp:SqlDataSource&gt;
  &lt;/form&gt;
  </code></pre>