Solved

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

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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SSRS 2016 Rendering HTML tables 3 85
reading an excel file vb.net 2 45
Trying to Create FTP Client in VB.net - getting errors 3 35
GUID's in SQL Server 4 30
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…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

737 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