Solved

how to refresh dataset and binded controls (like textbox) after change in database table.

Posted on 2004-08-05
6
269 Views
Last Modified: 2012-06-21
I have open a form "FormA". It has dataset table, and some controls like textbox are binded to this dataset, e.g.
txtState.DataBindings.Add("Text", myDataSet.Tables("patient"), "state")
While this form is open, I open another form "FormB" and in that I change the state value in the database table, close FormB and then come back to FormA.

Now I have to  refresh the dataset and textbox to show the current value of state, how is it possible.

Thanks a lot.
0
Comment
Question by:greatroni
[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
6 Comments
 
LVL 28

Expert Comment

by:iboutchkine
ID: 11729640
Just rebind textbox to the dataset after refreshin dataset

' Binds the textbox to the source
                txtState.DataBindings.Add("Text", myDataSet.Tables("patient"), "state")
0
 
LVL 18

Expert Comment

by:DotNetLover_Baan
ID: 11729750
Use this:
DataGrid.DataSource = Nothing
DataGrid.DataSource = YourDataSource
0
 

Author Comment

by:greatroni
ID: 11729803
 myDataSet.Clear()
   dataAdapterPatient.Fill(myDataSet, "patient")

This code did work, Thanks.
0
 
LVL 18

Expert Comment

by:DotNetLover_Baan
ID: 11730115
oops... I am sorry... I read the whole Dataset thing as DataGrid....  it has been a long day..
Good to hear that you find the solution...  good luck
0
 
LVL 1

Accepted Solution

by:
DarthMod earned 0 total points
ID: 11974923
Submitted to PAQ with points refunded (500)

DarthMod
Community Support Moderator
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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

623 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