title: The data types image and varbinary(max) are incompatible in the equal to operator
body: <p>One of my asp.net mvc project, i am trying to save an image to SQL Server Database table : <a href="https://i.stack.imgur.com/zCSu2.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>In my C# Controller, I am uploading a picture and <strong>converting it to byte[] array</strong> so that I can save it to database.My Code is like below.</p>
  
  <pre><code>    [HttpPost]
      [ValidateAntiForgeryToken]
      public ActionResult Create([Bind(Include = "CustIDNO, EDate,LetterNo,LetterFrom,LetterType,Comments, ValueTime")] WarningPic warningPic, HttpPostedFileBase img)
      {
          byte[] fileData = null;
  
          if (img != null)
          {
              //Here i am converting image to byte array
              using (var binaryReader = new BinaryReader(img.InputStream))
              {
                  fileData = binaryReader.ReadBytes(Request.Files[0].ContentLength);
              }
  
          }
  
          if (ModelState.IsValid)
          {
              warningPic.FileName = warningPic.CustIDNO.ToString();
              warningPic.Picture = fileData;
              warningPic.SlNo = 9;
  
              db.WarningPics.Add(warningPic);
  
              db.SaveChanges();
  
  
              return RedirectToAction("Index");
          }
  
          return View(warningPic);
      }
  </code></pre>
  
  <p>Everything should by okay , but i am getting a mysterious error like :
  <a href="https://i.stack.imgur.com/WTgUL.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <pre><code>The data types image and varbinary(max) are incompatible in the equal to operator.
  </code></pre>
  
  <p>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. </p>