updating an IMAGE column
-
Hello everyone, Recently I've inherited the maintenance of an application who's database contains and image column. I've received a few requests to update a few records, but I've never worked with image-typed columns before, and unfortunately the source code for the application is unavailable to me. I have the files I need to update the table with on my local machine - what would be the best way to get them into the table? Thanks in advance for any help.
------------------- abort, retry, fail?
-
Hello everyone, Recently I've inherited the maintenance of an application who's database contains and image column. I've received a few requests to update a few records, but I've never worked with image-typed columns before, and unfortunately the source code for the application is unavailable to me. I have the files I need to update the table with on my local machine - what would be the best way to get them into the table? Thanks in advance for any help.
------------------- abort, retry, fail?
Here is a small snippet of code from a C# bitmap helper library I use. I don't know of a way to handle this in SQL itself - I have always used an application to update image columns. _bm is a private Bitmap member variable. I use a stored proc to handle the update. I assign the returned byte array (returned as object) to the image parameter.
public object Save() { if (_bm == null) { return DBNull.Value; } else { MemoryStream ms = new MemoryStream(); _bm.Save(ms,_bm.RawFormat); byte[] buf = ms.GetBuffer(); ms.Close(); return buf; } }