473,387 Members | 1,942 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,387 software developers and data experts.

Sharing a dataset across multiple forms

1
Hi,

I really hope someone can help me out here.

In relation to this thread ( http://www.thescripts.com/forum/thread349557.html ) I'm having a similar issue and getting nowhere fast!

In a nutshell I have a MDI Container which can load up several forms.

Upon loading of a form, I want this form to either access or load a dataset and populate controls that have been bound to various fields of the dataset.

Likewise, should I load a different form, I want this 'new' form to load THE SAME dataset that is used on the first form, and any changes made on the first form reflected on the second and vice versa.

I emphasise "the same" dataset in the form for the following reason:

Suppose a dataset contains a field, with a value of "John"

Form 1 opens up the dataset, and changes "John" to "Jim". Form 2 is opened and shows the reflected changes to Form 1's dataset.

However... Form 3 can be opened (totally independent) which simply looks at the dataset before any changes, and so needs to read "John".

If the user saves the dataset in Form 1, or Form 2 with the field changed to "Jim", then all 3 forms will have the same data.

Did I explain that well?

One of the problems I foresee, which I'm sure someone will be able to answer is this:

Suppose Form 1 has it's dataset and works a-ok. A standard form with a dataset, populated from a SQL server, no problems at all.

When I come to design Form 2, which uses the same dataset as Form 1, how do I test my program at design time seeing as Form 1 has never actually been run in the first place?

I really could do with some help on this as I've spent days trying to work out something like setting Datasets to Shared, Friend, Public, references galore, and I'm just hitting brick walls.

Thanks in advance,
Jan 19 '07 #1
0 1333

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Cowboy \(Gregory A. Beamer\) | last post by:
Background: ------------- The idea started as a single sign on type of application. Having tested it before, I knew we could institute single sign on using the same Authentication Cookie name (in...
2
by: Mervin Williams | last post by:
I am using Infragistics UltraWebTab (a tab folder control for ASP.NET). My tab folder control will include five tab pages with a separate web form on each, and these web forms will share data. ...
2
by: Jeff Brown | last post by:
OK i have came to the conclusion that since this app will be run on multiple computers that loading a complete database and then updating on exit is a moot point. I have tried several ideas...
1
by: Daryll SHatz | last post by:
Is there a way to share a datase across multiple forms in a project? I have created a DataSet, using the Wizards, and bound several controls on my main form. All works well. Now I would like to...
2
by: John Granade | last post by:
I'm looking for the best way to make a dataset available from multiple Windows forms. The dataset is created from an XML file. I have a main form (frmMain) that loads the dataset and reads the...
3
by: Chris Thunell | last post by:
I have 2 forms, on 1 form i use the wizards to create a strong typed dataset with tables from an SQL database... and from that i can do stuff like: me.daEmployee.fill(me.dataset11.tblEmployee) ...
4
by: Robert Bravery | last post by:
Hi All, I'm New to VS.net. Trying to figure out this new dataset thingy. Ok so I add a dataadapter with all the correct properties for a table. Then generate the dataset. Now open the dataset and...
1
by: Leon_Amirreza | last post by:
Hi, I am wondering if there is a way to share a Dataset object on the main form of my C# App between other forms that I can bind other forms controls to this dataset (designer is not aware of a...
4
by: Steve Marshall | last post by:
I have come across the situation several times where a number of forms in an app use the same datasource, for example to populate a combo drop-down. I'm sure we've all had this. Using the IDE...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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...

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.