473,399 Members | 3,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

How to sycnc data in two form?

Hi all,
I hade made a programme there are two forms, one is used for show the result
other one is used for add and delete items.After I add or delete items in
one form , and how to make other form which is use for show result to
reflash the result and get the real data?
Nov 16 '05 #1
6 1113
Jet,

There are many ways to do this, but its hard to say what is best without
knowing your code.

You could create an event and hook into this on the other form. Raise the
event when your data changes and use the eventhanlder to refresh your other
form.

Alternatively just expose a public method on your child form and call this
from the parent form when the data changes.

Phil...
"Jet Leung" <xi**@tom.com> wrote in message
news:eQ**************@TK2MSFTNGP10.phx.gbl...
Hi all,
I hade made a programme there are two forms, one is used for show the
result
other one is used for add and delete items.After I add or delete items in
one form , and how to make other form which is use for show result to
reflash the result and get the real data?

Nov 16 '05 #2
Have both forms reference a common dataset, bind the displayed fields and
have the currency manager do the work for you.

"Jet Leung" <xi**@tom.com> wrote in message
news:eQ**************@TK2MSFTNGP10.phx.gbl...
Hi all,
I hade made a programme there are two forms, one is used for show the result other one is used for add and delete items.After I add or delete items in
one form , and how to make other form which is use for show result to
reflash the result and get the real data?

Nov 16 '05 #3
Hi Colin,
How to have both froms reference a common dataset? What does your mean?
And where the currency manager placed in?
The result showing form or the result modify form? Any sample?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #4
Hi Phil.
As you say, if I want to do this, I have to create an event and hook in
the result showing form , and raise the event in the other? Are there
any sample code to decript it?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #5
Have you main form/class create the dataset,
Create a DataView & DataSet on FormA and bind controls on FormA to DataView,
Create FormB and do the same as FormA,

From your main class pass the master DataSet to both forms, e.g. vFormA =
new FormA(MasterDataSet),
You constructor of FormA & FormB would be something like;
public FormA(DataSet pMasterDataSet)
{
InitializeComponent();
dataView1.DataTable = pMasterDataSet.Tables["Customer"];
}

Now both forms, DataViews & bound controls all point to the same DataSet.

- Colin

"Jet Leung" <xi**@tom.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi Colin,
How to have both froms reference a common dataset? What does your mean?
And where the currency manager placed in?
The result showing form or the result modify form? Any sample?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #6
Thank a lot!
Yes, I had created dataset in my main form. As you say, you mean if I
want to sycnc the result in two form, I have to transfer the dataset
from one form to other form? And make both two controls bind the same
dataset?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #7

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

Similar topics

1
by: dmiller23462 | last post by:
Hey guys.... I put an error-handling in my page and have it posted at the complete end of the code, see below(when people were putting in 's I was getting the delimiter errors). Great, I...
2
by: Citoyen du Monde | last post by:
Trying to get some ideas on a simple javascript project (to teach myself the language). I want to develop a client-side vocabulary practice application that would allow users to enter their own...
6
by: Hamed | last post by:
Hello I have employed as a developer in a software company that its team uses FoxPro / VB 6.0 / VC++ 6.0 as the developing tools and newly is going to migrate to VS.NET. There is a project...
10
by: Gregory A Greenman | last post by:
I'm trying to write a program in vb.net to automate filling out a series of forms on a website. There are three forms I need to fill out in sequence. The first one is urlencoded. My program is...
11
by: Johnny | last post by:
I'm a rookie at C# and OO so please don't laugh! I have a form (fclsTaxCalculator) that contains a text box (tboxZipCode) containing a zip code. The user can enter a zip code in the text box and...
8
by: Johnny | last post by:
I'm a rookie at C# and OO so please don't laugh! I have a form (fclsTaxCalculator) that contains a text box (tboxZipCode) containing a zip code. The user can enter a zip code in the text box and...
4
by: Alex Sibilev | last post by:
Hello, I have a really weird problem I've been trying to solve it without any luck for the last couple of hours :( I'm writing a "conference board" application (quite similar to ASP.NET...
8
by: hoofbeats95 | last post by:
I don't think this should be this complicated, but I can't figure it out. I've worked with C# for several years now, but in a web environment, not with windows form. I have a form with a query...
22
by: Zytan | last post by:
I have public methods in a form. The main form calls them, to update that form's display. This form is like a real-time view of data that is changing. But, the form may not exist (it is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...

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.