Solved

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

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

758 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

19 Experts available now in Live!

Get 1:1 Help Now