473,654 Members | 3,076 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Refresh BindingSource .net 2005

I have a Windows app I am developing in VS .NET 2005 that is required to
periodically look at the data in a table in an MS SQL 2000 database.

The data is being changed from an external stored procedure. All I want
the app to do is refresh the data bound controls on a timer tick.

I am using the new TableAdapter and BindingSource controls as
recommended in the Help. I am at a loss as to the method to use to get
the BindingSource to do another data fetch.

Thank you for your help in this matter.

Bryan Shaw
bs***@amerexene rgy.com
Jan 10 '06 #1
2 6324
Bryan,

The BindingSource can't trigger another fetch. What you have to do is
set the DataSource property to a new version of the table. However, this
will most likely cause the current position and whatnot to change.

You are better off updating the bound table with the changes from the
database (by cycling through the table and adding/deleting/editing the
records where appropriate).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Bryan Shaw" <bs***@amerexen ergy.dontspamme .com> wrote in message
news:e6******** ******@TK2MSFTN GP11.phx.gbl...
I have a Windows app I am developing in VS .NET 2005 that is required to
periodically look at the data in a table in an MS SQL 2000 database.

The data is being changed from an external stored procedure. All I want
the app to do is refresh the data bound controls on a timer tick.

I am using the new TableAdapter and BindingSource controls as recommended
in the Help. I am at a loss as to the method to use to get the
BindingSource to do another data fetch.

Thank you for your help in this matter.

Bryan Shaw
bs***@amerexene rgy.com

Jan 10 '06 #2
Thanks, Nicholas. I am not sure what you are saying. Let me try to
describe my scenario in more detail.

User open my windows app. There are three bound controls to the table
called tciBatchLog. BatchKey, DealNum and InvNum are the three bound
columns. The data at that time is 123, 25 and 1 perspectively.

Five minutes later, the timer tick event happens. I would like to
instruct the bound controls to report the new data. The new data would
be 123, 25 and 20 perspectively.

The data in tciBatchLog is being changed by an external process. All
this app is doing is looking at the data and reporting it. It's kind of
like checking your stocks periodically during the day.

So my question is, how do I instruct the bound controls to refresh with
the new data values?

Thanks again! I appreciate the help.

Bryan Shaw
bs***@amerexene rgy.com

Nicholas Paldino [.NET/C# MVP] wrote:
Bryan,

The BindingSource can't trigger another fetch. What you have to do is
set the DataSource property to a new version of the table. However, this
will most likely cause the current position and whatnot to change.

You are better off updating the bound table with the changes from the
database (by cycling through the table and adding/deleting/editing the
records where appropriate).

Hope this helps.

Jan 10 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4531
by: TN | last post by:
I just don't get the BindingSource class when it is bound to a class. Consider this code snip: ..... Private bSource As New BindingSource() Private dgv As New DataGridView() Public Sub New() InitializeComponent()
1
12160
by: Leonardo | last post by:
Hi. I'm trying to build my first application with database access using VB 2005. I'm a VB 6 programmer and learning everything again has been challenging. I managed to write a code using some tips from a book I recently bought. The navigation works fine. My problem starts when it comes to adding new registers. I have three tables: clients, addresses and telephones, so the client can have multiple address and telephones. The client data is...
3
1464
by: --== Alain ==-- | last post by:
Hi, I have a control which has a collection property. when an item of the collection property will be added, removed, and so on, i would like to refresh the control itself. Usually for that i use eventhandler in the set method of the property. But as the collection property has only a get method, i'm not able to do it so.
7
13444
by: Mike | last post by:
i have a small difficulties with BindingSource and dataGridView bind db has properly opened and bind doesn't works. Unfortunately I didn't find any good example how to connect MS Access with dataGridView and BindSource class. Maybe something like this: DataTable dtResult = new DataTable(); dtResult = GetData(); // this line returns a error GetData doesn't exists!
1
8111
by: Daniel Jeffrey | last post by:
..Net 2.0 VStudio 2005 C# I know this is going to seem like a strange question, as even I am sure I have missed something - but I cant find it. I want a simple event on any of the objects (BindingSource, DataSet, DataTable) that fires when data in a bound control changes.
4
4945
by: Christian | last post by:
Hi, i TRY to create a windows apllication that insert in a Access DB name and surname; the Insert istruction Works but the the refresh of DataGridView doesn't works... the code is : public Form1() { InitializeComponent(); } #region Variabili
2
4503
by: jehugaleahsa | last post by:
Hello: I'm working on improving some of our Windows Forms. I have created two user controls that I want to bind to the same BindingSource. I have an overview control that is used just to identify a customer. Then there is a details view that shows all their specifics. I wanted to keep navigation outside of my view. There is also a
5
4931
by: jehugaleahsa | last post by:
Hello: I am sure this question comes up a lot. I need to disable the controls on my Windows forms so that when the BindingSource is empty some the controls bound to it will be disabled. This will make it clear to the user that they have to create a new item first before they start working. This needs to be an easy process because there are many, many forms.
2
4659
by: TamusJRoyce | last post by:
I am working on a group project where I do not have access to a BindingSource that is being passed through a function. The BindingSource's DataSource is set to a custom IBindingListView Collection. When I try to set IsNew on the BindingSource having the custom IBindingListView, the BindingSource IsNew remaines false. I have been able to do a test with my own IBindingListView being set on the BindingSource, and if I set IsNew before I set...
0
8375
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8290
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8815
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8593
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7306
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6161
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2714
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.