I\'m trying to update my profile picture using varbinary (SQL Server 2008). It don\'t seem to update the picture that I put in the fileupload. Below is the code I use to update
try this:
... //insert the file into database string strQuery = "Update LoginRegisterOthers Set profilepic = (SELECT BULKCOLUMN FROM OPENROWSET(BULK N'"+filename+"', SINGLE_BLOB) AS FIle_picture) Where username = '" + username + "'"; ...
You can load a file directly with sql.