I work on C# window Visual Studio 2005. I save image on SQL Server using OLEDB command. In insertion I insert null value on image field. It works well, but a problem occurs when I try to update image. My update query is:
using (OleDbCommand Update = new OleDbCommand(
"UPDATE [BoardDetail] SET BoardImage= '(?)' WHERE BoardID='" + oItem.BoardID + "' AND BoardSerialNo='" + oItem.BoardSerialNo + "' ", connection))
{
OleDbParameter imageParameter =
Update.Parameters.Add("@image", OleDbType.Binary);
imageParameter.Value = content;
imageParameter.Size = content.Length;
Update.ExecuteNonQuery();
}
it works well but value on image column is null.