This works for me...
Save to byte array...
Code:
ImageConverter ic = new ImageConverter();
byte[] imageBuffer = (byte[]) ic.ConvertTo(MyImageVariable, typeof(byte[]));
Call a method that takes the byte array for data update..
Code:
public bool SaveSignature(int userID, byte[] signature)
{
DBCommandWrapper wrapper = _db.GetStoredProcCommandWrapper("CODBA.usr_UpdateSignature");
wrapper.AddInParameter("@UserID", DbType.Int32, buyerID);
wrapper.AddInParameter("@Signature", DbType.Binary, signature);
try
{
_db.ExecuteNonQuery(wrapper);
return true;
}
catch
{
throw;
}
}
Your stored procedure...
Code:
CREATE PROCEDURE CODBA.usr_UpdateSignature
(
@UserID SMALLINT,
@Signature IMAGE
)
AS
etc...normal database update now.