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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:27:38+00:00 2026-05-27T09:27:38+00:00

I can add data to database but there result of it I can only

  • 0

I can add data to database but there result of it I can only see after restart of my program. How to make it possible to add data and then(immediately. with waiting) see it in another window with datagrid?

  • 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-27T09:27:38+00:00Added an answer on May 27, 2026 at 9:27 am

    I am assuming you are binding the DataGrids Items property to your data, or something like that… Have you implemented INotifyPropertyChanged on whatever class your are holding your data in? This also supposes that you have some way of telling your DataSource to refresh it’s data. If you are issuing SQL commands that insert data, and you have a TableAdapter or something that is storing your local copy, but you don’t tell the TableAdapter to refresh from the database, you will never see your changes.

    This works best when using MVVM, but you can make it work otherwise. Essentially, you Add the PropertyChanged event and a handler to your class. I usually put a call to the handler in my property setter as well as any time I explicitly make changes to the properties value.

    This tells the UI that the data has changed in some way, and to refresh the Views representation of it.

    VB Example

    Public MyClass
    Implements INotifyPropertyChanged
    
    Public Event PropertyChanged As PropertyChangedEventHandler _
        Implements INotifyPropertyChanged.PropertyChanged
    
    Protected Sub OnPropertyChanged(ByVal info As String)
        RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(info))
    End Sub
    End Class
    

    C# Example

    public class DemoCustomer  : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
    
        private void NotifyPropertyChanged(String info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }
    }
    

    ObservableCollection

    I am also a huge fan of ObservableCollection. If you have the means to use it, I suggest it. It is IEnumerable and has INotifyCollectionChanged implemented on it already.

    Clarification of Databinding

    Lets Say you have a class (call it MyData) which you are using to contain your data, in this case a collection of Person objects (ObservableCollection People). Your XAML might look like this. This assumes that your MyData class has a default constructor for brevity.

    <Window>
        <Window.Resources>
            <local:MyData x:key="mydata"/>
        </Window.Resources>
        <DataGrid DataContext="{StaticResource mydata}" ItemsSource="{Binding People}"/>
    </Window>
    

    In this way the DataContext is describi9ng the location of the data, and the ItemsSource is telling what the control should do with it.

    Code Project article dealing with databinding DataGrid to TableAdapter data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way that I can add non-static data to dataannotation attributes (either
is it possible to add custom data to the results so it can be
How can I use data binding on a details form to add a new
I can add a normal rightBarButton to my navigation without a problem but now
I can add a Conditional statement to a breakpoint, for instance arg0.startsWith(something) but i'd
While we can add Inline Images in paragraphs there does not appear to be
I can add and remove the last line in my dynamic form and calculate
We can add an image to an photo album using UIImage *img = [UIImage
Can someone please direct me on how I can add something similar to inputAccessoryView
I wrote library which can add and update objects in salesforce. I use beatbox

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.