Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7974653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:26:13+00:00 2026-06-04T08:26:13+00:00

I want to return a image through webservice , so i tried to convert

  • 0

I want to return a image through webservice , so i tried to convert the image in database to byte then from byte to base64 string and return it to webservice , i am done with half the way but i could not return the whole string hope due to some restriction of string size or something else ?

<%@ WebService Language="C#" Class="Service" %>


using System;

using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;

using System.Collections;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;

using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.IO;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
// [System.Web.Script.Services.ScriptService]
public class Service : System.Web.Services.WebService
{
    public Service () {

        //Uncomment the following line if using designed components 
        //InitializeComponent(); 
    }

    [WebMethod]
    public string IMAGE(string ID)
    {


        SqlConnection conn = new SqlConnection("Data Source=NEWCRISP19;Initial Catalog=masselango;Persist Security Info=True;User");
        conn.Open();
        SqlDataAdapter sdImageSource = new SqlDataAdapter();
        sdImageSource.SelectCommand = new SqlCommand("select ImageData from ImagesStore where ImageId=('" + ID + "')", conn);
        DataSet dsImage = new DataSet();
        sdImageSource.Fill(dsImage);

        byte[] blob = (byte[])dsImage.Tables[0].Rows[0][0];
        String c = Convert.ToBase64String(blob);
        //c = c.Replace(" ", "");
        return c;


    }

}

The web.config is unmodified.

help me retrieveing the whole base64 string .

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T08:26:14+00:00Added an answer on June 4, 2026 at 8:26 am

    What i understood is you have stored image in database as binary and you want to retrieve it now.

    If that is you want then please check this Link Insertion and Retrieval of image in binary

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to return a private field from a remoted object but i get
I want to return a set of values from function till the point they
I want to return ArrayList<HashMap<String,String>> in EL function with three String argument. How to
I want to return an anonymous data retreived from a query in Linq. I
I have a url that when requested will return an image. I want the
I want to validate Image Resolution before upload an image in PHP through Javascript.
I have some image data (jpeg) I want to send from my iPhone app
I've built a REST webservice and I want to remove the slashes from my
I want to display an image on my website. I've been looking through the
I want to return some errors to my jquery method. What is happening is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.