473,666 Members | 2,538 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Master/Detail question

Suppose I have a data entry screen with two strongly-typed datasets,
dsCustomers and dsOrders, as the master and child, respectively.

Because the two tables in the relationship are in two different datasets, I
don't think I can use the DataRelation object to link them. If not, what is
the best way to set up the master/detail relationship for the Windows form
for these two tables? Should I just use a filter on the child table and
manually update it everytime the parent row changes? What approach would be
the fastest?

TIA,

Mike Rodriguez
Nov 17 '05 #1
4 2300
Mike,

I would create a new typed dataset which has the parent and child table
in the same dataset with the DataRelation defined. Then, you can just bind
the child grid to the relation, and it will show the appropriate child
records automatically.

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

"Michael Rodriguez" <mi**@nospamfor me.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Suppose I have a data entry screen with two strongly-typed datasets,
dsCustomers and dsOrders, as the master and child, respectively.

Because the two tables in the relationship are in two different datasets,
I don't think I can use the DataRelation object to link them. If not,
what is the best way to set up the master/detail relationship for the
Windows form for these two tables? Should I just use a filter on the
child table and manually update it everytime the parent row changes? What
approach would be the fastest?

TIA,

Mike Rodriguez

Nov 17 '05 #2
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:Ow******** ******@tk2msftn gp13.phx.gbl...
Mike,

I would create a new typed dataset which has the parent and child table
in the same dataset with the DataRelation defined. Then, you can just
bind the child grid to the relation, and it will show the appropriate
child records automatically.


Hi Nicholas,

While that would certainly work, there are reasons why I want to keep the
two distinct typed datasets. Is there any way to define a relationship in
that scenario, or is my only option a row filter?

Thanks,

Mike
Nov 17 '05 #3
Michael,

In that case, no, there isn't. You would have to filter it yourself.

You might want to consider using the unified data set. You can always
copy the data from the two data sets into this data set. It seems like a
lot of extra code and work to replicate behavior that is already in the
framework.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Michael Rodriguez" <mi**@nospamfor me.com> wrote in message
news:e$******** *******@TK2MSFT NGP15.phx.gbl.. .
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote
in message news:Ow******** ******@tk2msftn gp13.phx.gbl...
Mike,

I would create a new typed dataset which has the parent and child
table in the same dataset with the DataRelation defined. Then, you can
just bind the child grid to the relation, and it will show the
appropriate child records automatically.


Hi Nicholas,

While that would certainly work, there are reasons why I want to keep the
two distinct typed datasets. Is there any way to define a relationship in
that scenario, or is my only option a row filter?

Thanks,

Mike

Nov 17 '05 #4
Hi Nicholas,

After databinding the dataRelation to the childGrid, I would like to set the
allowNew = false so user can't add the row at the buttom of the childGrid.

However, there is no way to create a dataview for the dataRelation. In other
way, if I create a dataview with allowNew = false, then set the dataview to
be the childGrid datasource, the childGrid just can't change its row when
the currencymanager of the MasterGrid changes.

Is there any method to disallow the childGird add new rows?

Thank you.

Timothy
Feb 18 '06 #5

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

Similar topics

8
4388
by: Raphael Gluck | last post by:
Hi Everyone I am having some problems with a master detail page i have set up to catalogue brochures from my site. On my master page www.tripakltd.com/brochures.asp users are invited to select from a list of brochure categories, then once they press the submit button they will be taken to a different page www.tripakltd.com/library.asp The problem i am having, is that when I tell the detail page about the variable from the master page as...
1
2044
by: Jim Bob | last post by:
I Have a form with two datagrids bound to two tables in a dataset. The top datagrid is a master and the one below it is a detail. I want to be able to click on a row in the master and fire an event to update the botton grid with detail records related to the master. I havnt been able to find such a simple way to do this. Is this correct? How can I do this?
8
2045
by: Christopher Weaver | last post by:
I'm having the hardest time doing the simplest thing. I have a DataGrid bound to a table in a master detail DataRelation within a DataSet relTaskActivities = new DataRelation("TaskActivities", parentCol, childCol); dsTaskActivities.Relations.Add(relTaskActivities); dgActivity.SetDataBinding(dsTaskActivities, "Tasks.TaskActivities"); This works fine. I have a properly behaving master detail relationship.
2
1460
by: Marcel | last post by:
Hi, I'm new to VS and ASP.NET and have a question about master/detail datagrids. I have a master datagrid filled with data via a component that contains a SQL adapter. Now I would like to fill a detail datagrid (which will contain a number of detail records) based on the selected master. Is it possible to
12
7820
by: Gary Brower | last post by:
Hi, I am using VB.Net to create an ASP web form. My goal is to create a master/detail web form that allows users to create new master and detail records. For example the form would have header that would have fields for: Customer XXXXX CustomerAddress XXXXX CustomerEtc... XXXXX Then there would be a data grid that would allow the user to enter order information.
2
1285
by: HS1 | last post by:
Hello all I followed the example in Visual Studio.net to create a master and detail relationship as following: two tables: Customers and Orders two DataGrid: GridOrders and GridDetails -------------- Dim myDataRelation As DataRelation
3
1560
by: sqlboy2000 | last post by:
Hi, I've just started playing around with master / detail pages and I'm trying to simply change the detail page displayed in the contentplaceholder control from code behind. I can't seem to find any examples of this. Does anyone know how to do this? Thanks in advance.
1
2177
by: Sam | last post by:
Attached I am sending 2 URL's from MSFT ASP.net Quick Start Tutorial Web Site. 1) Run it URL: http://www.asp.net/QuickStart/aspnet/samples/data/GridViewMasterDetai... 2) View Source URL: http://www.asp.net/QuickStart/util/srcview.aspx?path=~/aspnet/samples...
0
1715
by: Mike Wilson | last post by:
Dear group, I have an invoice entry form, which is a simple Master fields / Detail grid. The main summary information of the invoice are stored in one table in a dataset, which is bound using a BindingSource (InvoiceBindingSource). The line details of each item in the invoice is held in a child table which is bound to another bindingsource (InvoiceRowsBindingSource). I took the basic design from an MSDN article, and all works well....
2
2281
by: John | last post by:
Hi I am trying to create a master/detail form. I have my master and details tables dragged onto the dataset. I have also dragged the fields from master table on the form which has created the navigation toolbar for me and which works fine with the master table. I also have a dataview on the same form ready for detail table but as yet not assigned to the detail table. How can I now create a master/detail relationship between my master and...
0
8454
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
8363
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
8883
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...
1
8561
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8645
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
5672
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
4200
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2776
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

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.