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 7624453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:58:08+00:00 2026-05-31T04:58:08+00:00

Many other methods in web service are used throughout the app and work just

  • 0

Many other methods in web service are used throughout the app and work just fine. Only one method in particular is giving trouble. When the method is invoked directly from browser, result is pretty instantaneous, so the web service itself seems to be fine. But when a breakpoint is placed on the line where the service is consumed for this particular method, everything freezes for about 1.5 to 2 minutes. Switched to async version of method and stopped the app from freezing, but the results of the method are not in the SQL database for the same 1.5 to 2 minutes. This method worked just fine up until a couple days ago and then suddenly started behaving this way.

    protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
    {
        base.OnActivityResult(requestCode, resultCode, data);

        if (resultCode == Result.Ok && requestCode == 0)
        {
            var settings = PreferenceManager.GetDefaultSharedPreferences(this);
            var assetID = settings.GetString("unit", null);
            var sender = settings.GetString("sender", null);

            var conn = inst2.conn();
            var c = conn.CreateCommand();
            c.CommandText = "Select Contract From CurrentContract";
            var transID = 0;
            try
            {
                conn.Open();
                SqliteDataReader dr = c.ExecuteReader();

                if (dr.HasRows)
                {
                    dr.Read();
                    transID = Convert.ToInt32(dr[0].ToString());
                }
                dr.Close();
                conn.Close();
            }
            catch (System.Exception ex)
            {             
                conn.Close();
                Dialog d = inst2.showBuilder(this, "Error", ex.Message);
                d.Show();
            }

            TableLayout tl = (TableLayout)FindViewById(Resource.Id.myEquip);
            View v1 = tl.FindViewWithTag(sender);
            Button bt = (Button)v1;

            Bitmap bitmap = (Android.Graphics.Bitmap)data.Extras.Get("data");
            string base64String = "";

            using (var stream = new System.IO.MemoryStream())
            {
                bitmap.Compress(Android.Graphics.Bitmap.CompressFormat.Png, 0, stream);
                byte[] imageBytes = stream.ToArray();
                base64String = Convert.ToBase64String(imageBytes);
            }

            try
            {
                //This is where it gets stuck
                inst.saveImage(base64String, assetID, transID);                  
                bt.Visibility = ViewStates.Invisible;
                conn.Open();
                c.CommandText = "Drop Table If Exists CurrentContract";
                c.ExecuteNonQuery();
                conn.Close();
            }
            catch (System.Exception ex)
            {
                conn.Close();
                Dialog d = inst2.showBuilder(this, "Error", ex.Message);
                d.Show();
            }


        }

    }

inst.saveImage is a void that runs a SQL stored procedure that simply updates the line of the contract with the base64 encoded string containing values from the camera intent.

    [WebMethod]
    public void saveImage(string stream, string assetID, int transID)
    {

        var conn = new SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ToString());
        var comm = new SqlCommand("saveContractImage", conn);
        comm.CommandType = System.Data.CommandType.StoredProcedure;
        comm.Parameters.AddWithValue("@AssetID", assetID);
        comm.Parameters.AddWithValue("@TransID", transID);
        comm.Parameters.AddWithValue("@Bytes", stream);

        try
        {
            conn.Open();
            comm.ExecuteNonQuery();
            conn.Close();
        }
        catch (Exception ex)
        {
            conn.Close();
            throw (ex);
        }
    }
  • 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-05-31T04:58:09+00:00Added an answer on May 31, 2026 at 4:58 am

    I think this may have been device specific. Have used on other devices since and seems to work ok.

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

Sidebar

Related Questions

Was just wondering how do these sites (and many other softwares that generate flash
I have a simple web service method that returns a simple java class as
Seen many other similar questions like this on this website and i would say
Possible duplicate of: should-i-link-to-google-apis-cloud-for-js-libraries also many other discussions, including: Where do you include the
I'm using boost::program_options and it suffers from the same as many other c++ libs,
C++ has std::vector and Java has ArrayList , and many other languages have their
Basically, I have a model where I've created a superclass that many other classes
C++0x is introducing unordered_set , which is available in boost and many other places.
I'm working with websites written in PHP, along with many other programmers, and sometimes
In C# , Ruby , and many other languages you can denote a string

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.