title: CS0117: 'System.Data.OleDb.OleDbType' does not contain a definition for 'Image'
body: <p>Help!</p>
  
  <p>I'm doing a page that will upload and display the image in gridview. When i load the page. </p>
  
  <p>This error showed up: CS0117: 'System.Data.OleDb.OleDbType' does not contain a definition for 'Image'</p>
  
  <pre><code> Compiler Error Message: CS0117: 'System.Data.OleDb.OleDbType' does not contain a definition for 'Image'
  
  Source Error:
  
  
  Line 26:  
  Line 27:  OleDbParameter UploadedImage = new OleDbParameter
  Line 28:               ("@Image", OleDbType.Image, imageSize.Length);
  Line 29: 
  Line 30:  UploadedImage.Value = imageSize;
  
  Source File: c:\inetpub\wwwroot\logon\try.aspx    Line: 28 
  </code></pre>
  
  <p>Here's my full 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.Image, imageSize.Length);
  
   UploadedImage.Value = imageSize;
   cmd.Parameters.Add(UploadedImage);
   con.Open();
   int result = cmd.ExecuteNonQuery();
   con.Close();
   if (result &gt; 0)
   lblMessage.Text = "File Uploaded";
   GridView1.DataSource = SqlDataSource1;
   GridView1.DataBind();
   }
  }
  &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" HeaderText="Image" SortExpression="Image"&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]"&gt;
  &lt;/asp:SqlDataSource&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Please Help! :)</p>