Solved

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

Posted on 2004-08-05
6
253 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
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

770 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