Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How do I solve error StatusCode: 500?

How do I solve error StatusCode: 500?

Scheduled Pinned Locked Moved ASP.NET
asp-netjsonhelpquestioncsharp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 11369001
    wrote on last edited by
    #1

    I am getting an error when I try to get case information from a database (Justice) Here is the error: {StatusCode: 500, ReasonPhrase: 'Internal Server Error', Version: 1.1, Content: System.Net.Http.StreamContent, Headers: {Pragma: no-cache Cache-Control: no-cache Date: Wed, 29 Jan 2020 22:07:12 GMT Server: Microsoft-IIS/8.0 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET Content-Length: 6066 Content-Type: application/json; charset=utf-8 Expires: -1 }} I need help to solve the error StatusCode: 500 When button is clicked JusticeContoller class is called. This is where I am getting an error on line response=await client.GetAsync("api/GetAllAcceptCAseNumbers/" + candidateCases);

    protected async void GetCasesButton_Click(object sender, EventArgs e)
    {
    //#region Required Field Validation
    if (CaseNumbersTextBox.Text.Length < 1)
    {
    string myStringVariable = "Case number textbox cannot be empty.";
    ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable + "');", true);
    return;
    }
    try
    {
    #region Get Batch Number
    int newBatchNumber = await CandidateCaseController.GetNextBatchNumber();
    #endregion
    #region Insert entered case numbers in database
    foreach (string caseNumber in userEnteredCaseNumberList)
    {
    EditCandidateCaseModel newCandidate = new EditCandidateCaseModel();
    newCandidate.CaseNbr = caseNumber;
    newCandidate.EntryStaffUserName = Helpers.Authentication.GetADEmail();
    await CandidateCaseController.PostCandidate(newCandidate);
    }
    #region Get MNCIS info on cases
    //candidateCasesString
    List smallEnoughStrings = new List();
    List mncisDetailList = new List();
    List smallEnoughMncisDetailList = new List();
    foreach (string smallEnoughString in smallEnoughStrings)
    {
    smallEnoughMncisDetailList = await FTACaseReseting.Controllers.JusticeController.GetAllAcceptCaseNumbers(smallEnoughString);
    mncisDetailList.AddRange(smallEnoughMncisDetailList);
    }
    #endregion

        }
        catch (Exception ex)
        {
            string errorMsg = string.Format("An error has occured in {0}. \\nException:\\n{1}"
    
    Richard DeemingR 1 Reply Last reply
    0
    • U User 11369001

      I am getting an error when I try to get case information from a database (Justice) Here is the error: {StatusCode: 500, ReasonPhrase: 'Internal Server Error', Version: 1.1, Content: System.Net.Http.StreamContent, Headers: {Pragma: no-cache Cache-Control: no-cache Date: Wed, 29 Jan 2020 22:07:12 GMT Server: Microsoft-IIS/8.0 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET Content-Length: 6066 Content-Type: application/json; charset=utf-8 Expires: -1 }} I need help to solve the error StatusCode: 500 When button is clicked JusticeContoller class is called. This is where I am getting an error on line response=await client.GetAsync("api/GetAllAcceptCAseNumbers/" + candidateCases);

      protected async void GetCasesButton_Click(object sender, EventArgs e)
      {
      //#region Required Field Validation
      if (CaseNumbersTextBox.Text.Length < 1)
      {
      string myStringVariable = "Case number textbox cannot be empty.";
      ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable + "');", true);
      return;
      }
      try
      {
      #region Get Batch Number
      int newBatchNumber = await CandidateCaseController.GetNextBatchNumber();
      #endregion
      #region Insert entered case numbers in database
      foreach (string caseNumber in userEnteredCaseNumberList)
      {
      EditCandidateCaseModel newCandidate = new EditCandidateCaseModel();
      newCandidate.CaseNbr = caseNumber;
      newCandidate.EntryStaffUserName = Helpers.Authentication.GetADEmail();
      await CandidateCaseController.PostCandidate(newCandidate);
      }
      #region Get MNCIS info on cases
      //candidateCasesString
      List smallEnoughStrings = new List();
      List mncisDetailList = new List();
      List smallEnoughMncisDetailList = new List();
      foreach (string smallEnoughString in smallEnoughStrings)
      {
      smallEnoughMncisDetailList = await FTACaseReseting.Controllers.JusticeController.GetAllAcceptCaseNumbers(smallEnoughString);
      mncisDetailList.AddRange(smallEnoughMncisDetailList);
      }
      #endregion

          }
          catch (Exception ex)
          {
              string errorMsg = string.Format("An error has occured in {0}. \\nException:\\n{1}"
      
      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      An internal server error just means something has gone wrong in the server-side code. You'll need the actual error details to work out what the problem is. Assuming the error is coming from the GetAllAcceptCaseNumbers method, the problem is with the service you're calling, not the code you've shown. You'll need to contact the developer(s) responsible for that service to fix the problem.


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      U 1 Reply Last reply
      0
      • Richard DeemingR Richard Deeming

        An internal server error just means something has gone wrong in the server-side code. You'll need the actual error details to work out what the problem is. Assuming the error is coming from the GetAllAcceptCaseNumbers method, the problem is with the service you're calling, not the code you've shown. You'll need to contact the developer(s) responsible for that service to fix the problem.


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        U Offline
        U Offline
        User 11369001
        wrote on last edited by
        #3

        Thank you for your response. You are exactly right. I did talk to someone and I need to get username and password the app need to use to connect to the server.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups