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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:46:17+00:00 2026-05-22T23:46:17+00:00

I have two listboxes where I copy data from one listbox to another listbox.

  • 0

I have two listboxes where I copy data from one listbox to another listbox.
The rows that get moved into the second listbox need to be saved to a different table than the table that the records originated.

So, I have a UserProfile table with a list of people in the entire company. I select only the individuals that will participate in the project.

I need to save these individuals into a different table that only has people who are members of that project. I used HttpRequest to get the new individuals from the second list box. I then have a method using Linq Query that retrieves the rows by UserId from the UserProfile table.

Now that I have the rows I need from the UserProfile table, how do I go about inserting these individuals into a new table? I already have an IQueryable of the people I need to save to this table. How do I save these list of members into this new table in asp.net mvc and entity framework? Thanks

  • 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-22T23:46:18+00:00Added an answer on May 22, 2026 at 11:46 pm

    Is the IQueryable class of the same type of your table that you are inserting into? I’m assuming yes but if not you’d just need to map columns first.

    Here is my controller code for inserting a category record, my table is named lm_r_category in Entity Framework. This code gets triggered from a Telerik ASP.MVC grid via Http Post but could be triggered however you’d like.

    lm_r_category is my EF class for the table I’m inserting to. If you are using a different class, simply create a new instance of lm_r_category and map column values before doing the AddObject. As you can see doing Inserts in EF is extremely simple.

    [HttpPost]
    [GridAction]
    public ActionResult GridInsert(lm_r_category category)
    {
        if (ModelState.IsValid)
        {
            // add instance of lm_r_category representing 
            // the new row.
            db.lm_r_category.AddObject(category);  
    
            // save the changes
            db.SaveChanges();
        }
         return View(new GridModel(db.lm_r_category));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two listboxes that I am dragging one item from to the other.
I Have two listboxes when I drag One item from the source listbox I
I get data from asynchronous method. E.g i have two ListBox .When selection changed
My scenario is this: I have two listbox's, one that contains all my database
I have two ListBoxes, one inside another. And both ListBoxes will have items dynamically
I have two listboxes that are very close together, one on top and one
I have two ListBoxes, lstAvailableColors and lstSelectedColors. Between each listbox are two buttons, Add
I have a databound listbox which is actually displaying two columns of data. It
I have two views of some data: a list view (a ListBox now, but
I have two listboxes and two buttons. Each listbox is in its own div

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.