I am getting this follwing sql exception while inserting an Image into sql server 2008.
Implicit conversion from data type nvarchar to varbinary(max) is not
allowed. Use the CONVERT function to run this query
In the database Image column datatype is Varbinary(MAX).
Edit
Code lifted from comment
paramaters.Add(getParam("@imageFilePath", DbType.AnsiString, imageFilePath));
Best Answer
Use this to read the file into a byte array:
or
Then save the image data using this (I am using an image class "instance" that contains my image information and byte array in instance.Data):
And here is an example stored procedure: