473,813 Members | 3,190 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sharing a dataset across multiple forms

1 New Member
Hi,

I really hope someone can help me out here.

In relation to this thread ( http://www.thescripts. com/forum/thread349557.ht ml ) 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 1365

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

Similar topics

4
2052
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 this case "AuthenticationCookie" -- yeah, original, I know) and the same machine keys for the applications. <authentication mode="Forms"> <forms name="AuthenticationCookie" path="/" loginUrl="login.aspx" protection="All" timeout="10" />
2
301
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. My questions regard the data tier, that is, how I should construct the data objects so as to reduce memory usage while optimizing page performance? 1. I'll be using data sets. How can I share a single data set across the multiple web forms? 2....
2
1838
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 submitted, but i am unable to get one of them to work completely. Here is the code i had before i realized that when i filled the dataset in the form load procedure that it would "ruin, replace, mess up" the dataset named the same thing on the other form....
1
2701
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 use the DataSet data with controls on several Dialog forms in the same project. Is the a way to make/create a "global" DataSet for all objects in the same project?
2
6906
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 data but then I have other forms that give the ability to add, modify, and delete rows. This of course changes the dataset and I need that reflected in the main form. At first I was actually passing a reference of the dataset to the "modify" form...
3
2448
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) plus some 3rd party controls can see it the datatables etc etc. Is there anyway when i open the second form that this information that has already been loaded into my in-memory dataset be available on all my other forms... and still be strong...
4
1445
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 drag another table from the server explorer, set up some relations there. Set up two grids, one a s a parent one as a chgild. Fill the dataset, run the form But my child grid never gets any records. I then added another datadapter for the child...
1
1733
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 public member of the mdi parent form)? Or any better practice than sharing a dataset among forms? I need a centeral managable access to the database! thanks
4
1220
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 results in every form getting its own Dataset, BindingSource and TableAdapter, plus code in the Open event to fill the table in the dataset. This strikes me as incredibly inefficient - there is simply no need for every form to go to the database to...
0
9609
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
10408
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10141
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
9225
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
7686
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
6897
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5707
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4358
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
2
3886
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.