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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:26:05+00:00 2026-06-01T00:26:05+00:00

Visual Studio 2010 Express, Windows Forms. Have made myself my first little application which

  • 0

Visual Studio 2010 Express, Windows Forms.

Have made myself my first little application which used a local database (a journal app).
First form (which load when app starts) shows every entry that has been made.
A “Add button” show up a new form, from where I can add a new entry.

Now, everything works this far.

But when I close the add form, after adding a new entry, the new entry isn’t displayed in the first form. I have to close the program and start it up again the see the new entry.

How can I refresh the data in the first form, when the add form closes?

Best regards from Denmark

  • 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-01T00:26:07+00:00Added an answer on June 1, 2026 at 12:26 am

    First of all you must open your second form as dialog like new FormAdd().ShowDialog(this);

    this will stop the code until FormAdd close, then you can reload the data as you load in form firs load.

    your code will be like this

    private void Form1_Load(object sender, EventArgs e)
    {
        LoadData();
    }
    private void btnAdd_Click(object sender, EventArgs e)
    {
        new FormAdd().ShowDialog();
        LoadData();
    }
    private void LoadData()
    { 
       //load your data
    }
    

    by the way you can use DialogResult for unnecessary prevent refreshs is user does not insert a record to db. in FormAdd code set DialogResult value and in main form use like this

    private void btnAdd_Click(object sender, EventArgs e)
    {
        if (new FormAdd().ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
            LoadData();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have just installed Windows Phone 7 CTP (Visual Studio 2010 Express) When I deploy
In C#, .NET 2.0, Windows Forms, Visual Studio Express 2010, I'm saving an image
Visual Studio 2010 RC -> Silverlight Application We have a library of images that
I downloaded the Microsoft Visual Studio 2010 Express for Windows Phone and I wrote
Taken from Exercise 1: Creating Windows Phone Applications with Microsoft Visual Studio 2010 Express
I have an ASP.NET MVC 3 .NET application under Visual web developer Express 2010.
I am using Windows 7 and Visual Studio 2010 express. What is the bare
I am using express edition visual studio 2010 for windows phone 7 , 7.1
I have two file generated in visual studio c++ 2010 express. test2.cpp // test2.cpp
I'm making an app for windows phone 7 (using Visual Studio 2010 Express for

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.