Solved

How do I refresh a database / datagrid at runtime?

Posted on 2007-11-23
6
180 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

724 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