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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:28:59+00:00 2026-05-26T23:28:59+00:00

I have 2 forms. Form1 contains a datatable. When I instantiate form2, I pass

  • 0

I have 2 forms. Form1 contains a datatable. When I instantiate form2, I pass it one record from form1’s datatable. Then I do some things in form2, and now I want to update the datatable in Form1, based on what was done in form2.

How can I accomplish this? I need to remove datarows, and add new datarows, and I must have the data from form2 to accomplish this.

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

    From this post:

    • Create a public property in form2:

      public partial class Form2 : Form {
      
          private DataTable data;
      
          public DataTable Data {
              get { return data; }
          }
      }
      
    • And access it in form1 when you’re done with form2:

      //...
      form2.ShowDialog();
      // Retrieved modified dataTable
      dataTable = form2.Data;
      //...
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let say I have are two WPF forms: Form1 and Form2 . Form1 contains
I have 2 Forms (Form1 and Form2) and a class (Class1). Form1 contains a
We have an MDI form which contains some number of child forms which have
Consider this scenario: I have two forms (Form1 and Form2). When a button is
I currently have a parent control (Form1) and a child control (Form2). Form1 contains
Possible Duplicate: How do you pass an object from form1 to form2 and back
I have 2 forms. Form1 with one panel and 2 buttons (pnl1, btnShowTree and
I have 2 forms: Form1 and Form2. I opened Form2 using: Form2 newForm2 =
I have a form MainForm which is a Windows Forms form that contains many
Scenario I have a C# Win Forms App, where the Main Form contains a

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.