Solved

How do I refresh a database / datagrid at runtime?

Posted on 2007-11-23
6
176 Views
Last Modified: 2008-02-01
I have a datagridview control on my form which is connected to a database. I have a button on my form which executes a stored procedure against the table which is a NonQuery procedure.

Everything works fine, but the datagridview on the screen does not reflect the current state of the database until I close the program and restart it.

Is there any way to refresh the grid so to speak while the program is running?
0
Comment
Question by:BIGZIPZ1
  • 3
  • 3
6 Comments
 
LVL 23

Accepted Solution

by:
Ashish Patel earned 500 total points
ID: 20339785
You will need to recall the sub routine or function after the procedure is ran which fills your datagrid or else refresh the entire form.
0
 

Author Comment

by:BIGZIPZ1
ID: 20339843
I tried "Form1.JackBennyTableAdapter.Fill(Form1.LibraryDataSet.JackBenny)" to fill the form again and the old data remained.

I also tried "Form1.Refresh" to and it stayed.
0
 
LVL 23

Expert Comment

by:Ashish Patel
ID: 20339881
after this Form1.JackBennyTableAdapter.Fill(Form1.LibraryDataSet.JackBenny) try rebinding the adapter to datagrid and try.
0
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 

Author Comment

by:BIGZIPZ1
ID: 20339976
"try rebinding the adapter to datagrid and try."

I am not sure how to do this.
0
 
LVL 23

Expert Comment

by:Ashish Patel
ID: 20340030
How do to apply data adapter to data grid, that is binding. Try refreshing the data adapter and refill it.
0
 

Author Comment

by:BIGZIPZ1
ID: 20340067
The TableAdapter control doesn't have a refresh command.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now