views:

38

answers:

0

I'm using EF4 to update a table with blob field. My code snippet is below:

public void SavePolicyDocument(int policyID, int batchID, byte[] file)
    {
        PolicyDocument policyDocument = GetPolicyDocument(policyID, batchID);
        policyDocument.DocumentImage = file;
        myEntities.PolicyDocuments.ApplyCurrentValues(policyDocument);
        myEntities.ObjectStateManager.ChangeObjectState(policyDocument, EntityState.Modified);
        myEntities.SaveChanges();
    }

If the blob field of the PolicyDocument is null, the updating the blob field works fine. If there's value in the blob field, I get a timeout error in updating the record.

Thanks for any ideas.