The example used in this article is based on the Microsoft Enterprise Library
When you insert a database, DB. addinparameter (dbcommand, "aimg", dbtype. Binary, model. aimg) is used );
DB. addinparameter (dbcommand, "aimg", dbtype. Binary, model. aimg) was used for the first update. The result failed.
Each second update uses a self-written method:
/// <Summary>
/// When storing BLOB, the content is stored in oracleparameter. if the content is empty, varchar2 is used. Default direction input.
/// </Summary>
/// <Param name = "orakey"> Field </param>
/// <Param name = "value"> value </param>
/// <Returns> </returns>
Public static idataparameter createblobparameter (string orakey, byte [] value)
{
Oracleparameter Param = NULL;
Param = new oracleparameter (orakey, oracletype. Blob );
If (value! = NULL & value. length> 0)
{
Param. value = value;
}
Else
{
Param. value = dbnull. value;
}
Param. Direction = parameterdirection. input;
Return Param;
}
The result still failed.
Later, I added a statement (statement A) to update myimagetab set aimg = empty_blob () Where id = 1, and then executed the update statement. The result was successful.
I may be confused later. I deleted this statement a, and the subsequent update was successful.
Possible cause: the original image is too large and cannot be updated for different types.