sql server - Display image from database with the type binary/byte[] -
ive stored image memorystream database, want display image in view since type of binary dont know how , im trying convert string. think have enough code in controller enable me display image dont know how display it.
another important thing need show image in _viewstart.cshtml, appear on everysite. (pagedata["logourl"] = "imagefromdatabase";)
this how far ive been able do:
public void show( models.editlogomodel mlogo, int id, object data) { var service = servicefactory.instance.createlogoservice(); if (data != null) { if (request.querystring["id"] != null) { byte[] logo = mlogo.dblogo.picimgdata; response.buffer = true; response.charset = ""; response.cache.setcacheability(httpcacheability.nocache); response.contenttype = mlogo.dblogo.picimgdata.tostring(); response.binarywrite(logo); response.flush(); response.end(); } }
Comments
Post a Comment