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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:35:59+00:00 2026-05-21T06:35:59+00:00

I have a DB which looks like this: 1st: CommissionsV2 (Table = Entity_Product_Point) This

  • 0

I have a DB which looks like this:

1st:

CommissionsV2 (Table = Entity_Product_Point)
This is my DBML too which has only one table.

2nd:

WebEnroll (Table = PlanMaster)
This is my another DBML which has one table in it.

Now through LINQ I am adding a row in this which has a query like this:

                        CommissionsV2DataContext cv = new CommissionsV2DataContext();
                        Entity_Product_Point ev = new Entity_Product_Point();
                        ev.Entity_ID = getEntity;
                        ev.Product_ID = tr.First();
                        ev.HiCommissionOld = (double)firststYrComp;
                        ev.LowCommissionOld = (double)recurringComp;
                        ev.HiCommission = (double)finalFirstYrComp * 100;
                        ev.LowCommission = (double)finalRecurringComp * 100;
                        ev.DateCreated = System.DateTime.Now;

                        cv.Entity_Product_Points.InsertOnSubmit(ev);
                        cv.SubmitChanges();

Now my update statement is like this:

 protected void gvShowComm_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {

        //Getting the Entity_ID from the Session!
        int getEntity = Int16.Parse(Session["EntitySelected"].ToString());

        //Accessing the variables from the controls!
        System.Web.UI.WebControls.TextBox product_ID = gvShowComm.Rows[e.RowIndex].FindControl("ProductName") as System.Web.UI.WebControls.TextBox;
        System.Web.UI.WebControls.TextBox planName = gvShowComm.Rows[e.RowIndex].FindControl("PlanName") as System.Web.UI.WebControls.TextBox;
        System.Web.UI.WebControls.TextBox hiCommOld = gvShowComm.Rows[e.RowIndex].FindControl("HiComm") as System.Web.UI.WebControls.TextBox;
        System.Web.UI.WebControls.TextBox lowCommOld = gvShowComm.Rows[e.RowIndex].FindControl("LowComm") as System.Web.UI.WebControls.TextBox;

        //Storing the values into variables!
        int product = Int16.Parse(product_ID.Text);
        string plan = planName.Text;
        int hiOld = Int16.Parse(hiCommOld.Text);
        int lowOld = Int16.Parse(lowCommOld.Text);

        //Updating the values into the table through LINQ!
        dbWebEnrollDataContext dt = new dbWebEnrollDataContext(); //This has PlanName in PlanMaster Table.
        CommissionsV2DataContext cv = new CommissionsV2DataContext(); //Entity_Product_Point has all the other columns which needs to be updated!

        Entity_Product_Point ev = cv.Entity_Product_Points.Single(c => c.Product_ID == product);
        ev.HiCommissionOld = hiOld;
        ev.LowCommissionOld = lowOld;
        ev.Entity_ID = getEntity;
        cv.SubmitChanges();
  • 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-21T06:36:00+00:00Added an answer on May 21, 2026 at 6:36 am

    In order to update, you need to retrieve the entity that needs to be updated.

    So in your case it would be:

    Entity_Product_Point ev = cv.Entity_Product_Points.Single(c => c.Product_ID == product);
    ev.HiCommissionOld = hiOld;
    ev.LowCommissionOld = lowOld;
    // Retrieve the plan that needs to be updated and set the name
    // Submit the changes
    cv.SubmitChanges();
    // Retrieve the new values and rebind the gridview against the new values
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table with 3 columns which looks like this: File User Rating
Suppose I have an SQL table entitled Facility which looks like this: || FacilityID
I have a string which looks like this: email@domain1.com|email@domain5.com I need only the email
For example, I have a table which looks like this : id | name
I have a class which looks something like this: public class Test { private
I have inherited a subversion repo which looks like this: https://foo/product/src I want to
I have an ASP.NET GridView which has columns that look like this: | Foo
I have gridview in my asp.net 3.5 application [C#]. Which looks like this: <asp:GridView
I have a table that looks something like this: CREATE TABLE student_results(id integer, name
I have sitemap which looks like this: <?xml version=1.0 encoding=utf-8 ?> <siteMap xmlns=http://schemas.microsoft.com/AspNet/SiteMap-File-1.0 >

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.