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

  • Home
  • SEARCH
  • 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 7956193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:55:19+00:00 2026-06-04T03:55:19+00:00

Guys I’ve a EntityModel called mapsModel , which has an entity Type called ‘BodyChartNew’

  • 0

Guys I’ve a EntityModel called mapsModel, which has an entity Type called ‘BodyChartNew’

For Inserting records I’m using a Handler called InsertMap, In this handler I’m using the code like as follows:

using System;
using System.Web;

public class InsertMap : IHttpHandler
{

    private mapsModel.mapsEntities _dataContext = new mapsModel.mapsEntities();

    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/plain";

        // Extract form fields
        var title = context.Request["title"];
        var note = context.Request["remarks"];
        var referenceID = context.Request["patient_id"];
        var diagnosisID = context.Request["diagnosis_id"];

        // Create Chart to insert
        var mapsToInsert = new mapsModel.BodyChart { MapCode = title, Remarks = note, PatientID = Convert.ToInt32(referenceID), DiagnosisID = Convert.ToInt32(diagnosisID) };

        // Save new movie to DB
        try
        {
            _dataContext.AddToBodyChart(mapsToInsert);
            _dataContext.SaveChanges();
            // Return success
            context.Response.Write("success");
        }
        catch
        {
            context.Response.Write("fail");
        }
    }

    public bool IsReusable
    {
        get
        {
            return false;
        }
    }
}

I’m calling this Handler from my JQuery Code, This is working fine for me with INSERT, what I need is UPDATE code. What is the UPDATE statement to update the records based on referenceID and diagnosisID ?

Please help me!

  • 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-04T03:55:20+00:00Added an answer on June 4, 2026 at 3:55 am

    You need to bring down the entity from the database (something like

    var entity = _dataContext.BodyChart.Single(e => e.PatientID = context.Request["patient_id"]);
    

    modify properties you want to modify and call

    _dataContext.SaveChanges()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

guys which text editor is good for Rubyonrails? i m using Windows and i
Guys, I have a CSS Layout that I am using that has a header,
Guys, I am using SQL Server 2000 and executing the sp_columns stored procedure to
Guys, what is function called after my class loaded, where i can call self
guys i have arrays in which i have to match this kind of text
Guys i am very new to jQuery. I have started using the auto complete
guys. I have UITableView with different cells and I have code, which counts height.
Guys, I am using dynamic programming approach to solve a problem. Here is a
guys i have a xml file which is like this: <Point TestFlag=0 id=1 name=Conversation
guys, I'm trying to realize viewing comments on internet portal and I'm using UITableView.

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.