c# - Update Linq Query For Image (File Upload) -


how can set true query update? can not part

 var image = add.image.toarray();  

i must image column userimage

            string filename = fileupload1.filename;              byte[] filebyte = fileupload1.filebytes;             binary binaryobj = new binary(filebyte);              var add = u in db.userimage                           u.user_id == id                           select u;              foreach (var u in update7)             {                 u.image = binaryobj;                 u.imageobj = filename;              }                  db.submitchanges();              var image =*add.image*.toarray();             byte[] foto = (byte[])image;             typeconverter cc = typedescriptor.getconverter(typeof(bitmap));             bitmap = (bitmap)cc.convertfrom(foto);              string img = convert.tobase64string(foto);             image1.imageurl = string.format("data:image/bmp;base64,{0}", img); 

can try one? 2 cents.

var add = u in db.userimage           u.user_id == id           select u; foreach (var u in add) {    u.image = binaryobj;    u.imageobj = filename; } db.savechanges(); 

Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -