title: "String or binary data would be truncated" in uploading file in ASP.NET MVC3
body: <p>I'm developing some application in ASP.NET MVC3 and trying to upload some file in SQL Server 2008, I have the type varbinary(MAX) in DB and I have the code below for uploading it, but I get the error "String or binary data would be truncated . The statement has been terminated" which I believe it's a data base error, where do you think my problem is? thanks</p>
  
  <pre><code>if (UploadedFile != null)
              {
                  App_MessageAttachment NewAttachment= new App_MessageAttachment { FileName = UploadedFile.FileName, FilteContentType = UploadedFile.ContentType, MessageId = NM.Id, FileData = new byte[UploadedFile.ContentLength] };
                  UploadedFile.InputStream.Read(NewAttachment.FileData, 0, UploadedFile.ContentLength);
                  db.App_MessageAttachments.InsertOnSubmit(NewAttachment);
                  db.SubmitChanges();
              }
  </code></pre>