Hi,
While reading a image from database i am not getting full image, i'm getting some upper part of the image only. My image is stored in binary format in database (varbinary(Max)). If image size is less then 20kb i am getting full image. Ex. if i select mobile it is showing like below image, what i want is full image. Here i don't want to use any handlers, Displaying in same page. i am using SQL-2014, MSVS-2015(c#, Asp.Net).


mehul kachhwaya45 pointsPosted Oct 13, 2016, 3:06 AM EDT
Stream strm = upload1.PostedFile.InputStream; BinaryReader reader = new BinaryReader(strm); Byte[] bytes = reader.ReadBytes(Convert.ToInt32(strm.Length)); imgDetail.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(bytes, 0, bytes.Length); imgDetail.Visible = true;Kvr Krishna2 pointsPosted Oct 13, 2016, 3:47 AM EDT
SqlCommand cmd = new SqlCommand("proc_take", con); cmd.CommandType = CommandType.StoredProcedure; byte[] b = (byte[])cmd.ExecuteScalar(); string Base64String = Convert.ToBase64String(b); Image1.ImageUrl = "data:image/jpg;base64," + Base64String;mehul kachhwaya45 pointsPosted Oct 13, 2016, 4:04 AM EDT