473,804 Members | 3,029 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Nested tables - How do you add a new row to a nested table? (codeattached)

I have a dataset setup with a main table that has some information in it
along with an element that is a nested table so that I can store rows of
history information for that one row in the main table. This all works
fine in a datagrid I can add rows to the nested table of any of my
customer rows... However in code I can't figure out how to do the same
thing... the only function I can find is "GetHistoryRows "... I'm
completely lost here - how would I go about adding a history row?

Below is a simple version of the schema that i'm using:

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="debug" targetNamespace ="http://tempuri.org/debug.xsd"
elementFormDefa ult="qualified"
attributeFormDe fault="qualifie d" xmlns="http://tempuri.org/debug.xsd"
xmlns:mstns="ht tp://tempuri.org/debug.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="u rn:schemas-microsoft-com:xml-msdata">
<xs:element name="debug" msdata:IsDataSe t="true">
<xs:complexType >
<xs:choice maxOccurs="unbo unded">
<xs:element name="customers ">
<xs:complexType >
<xs:sequence>
<xs:element name="name" type="xs:string " minOccurs="0" />
<xs:element name="history">
<xs:complexType >
<xs:sequence>
<xs:element name="date" type="xs:dateTi me" minOccurs="0" />
<xs:element name="descripti on" type="xs:string " minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
Nov 17 '05 #1
1 2699
If you're storing the data in a DataSet then you need a second
DataTable, say called CustomerHistory , that has a foreign key relation
with your Customer table, in a parent / child relationship, where
Customer is the parent, and CustomerHistory is the child table.

Effectively, every row in the CustomerHistory table will have some sort
of identifier to indicate to which Customer it belongs. The table will
store history for all customers, but you'll know to which Customer a
given row of CustomerHistory belongs by looking at that identifier.

You can also enforce this relationship in ADO.NET using a
ForeignKeyConst raint.

Nov 17 '05 #2

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

Similar topics

1
4699
by: siu02rk | last post by:
Hello All, Can anyone please explain to me why you would need to use Nested tables and give an example. Also can you show the SQL to view the table and the nested table and explain the logic of it. Thanks in advance for your help.
1
2754
by: Joseph Ferris | last post by:
Hello, I am having an issue with page breaking that I hope someone will be able to help me with. Still a relative "newbie", and I thought this might be a good place to find some help. I have a complex FO that contains nested tables. There are a few places where my breaks are not being rendered, although other ones work fine. I've made an FO that can reproduce this behavior. It is: <?xml version="1.0" encoding="UTF-8"?>
1
1605
by: boris bass | last post by:
Below is linenumbered as well as original code -------------------------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=windows-1255"> <META content="Microsoft FrontPage 5.0" name=GENERATOR></HEAD> <BODY text="#525252" vLink="#6666ae" aLink="#6666ae" link="#6666ae"
1
2512
by: Eric Bohlman | last post by:
What's the correct technique for nesting a bordered table inside of cell of another bordered table without getting a double-thickness border around the nested table? This is assuming the collapsing-border model. An example of where I have a good reason to do this is at <http://www.wayneengineering.com/literature/wcsf-settings.php>. In this case I was able to get away with using ordered lists for the parameters with enumerated values,...
5
13151
by: Roedy Green | last post by:
I generate code to refer people to bookstores that generates a table without internal borders. You can see an example on http://mindprod.com/environment/kyoto.html I can use this element nested in a table without borders just fine. However if I use it in a bordered table as on http://mindprod.com/jgloss/who.html It becomes a mess. Every cell gets a border, overriding the normal borderless styles.
1
1863
by: travis_brooks | last post by:
greetings I had a javascript that was reliably telling me the position of an image on a page, and now its not. I was using the script to draw a bounding box that followed the mouse around over the image, and when you clicked the mouse the x-y position of the image pixel the mouse was over was posted back in the form. I just changed the layout of the page so that the image is now in a table that is nested in another table, and the old...
1
4011
by: le_sloth | last post by:
Hi I'm generating a series of reports from an application that will be published on a client's intranet. The idea is that each of these reports is arranged into major product groups, sub-groups and product lines. All of this is to be in a table with one header. Example here:
5
3184
by: Giggle Girl | last post by:
Is there a way to prevent properties (specifically, height and background color) from being "inherited" by nested tables? Something similar (but sort of opposite to) !important, like "!no-inherit"? I have done a workaround, which is declaring a new class, like this TABLE.header_1 TD.no_inherit {
6
2762
by: R144N | last post by:
Hi Everyone, I have finally taken the step to bring a site to the 21st century with HTML 4.01 with the height tag having been deprecated. I have read numerous articles claiming that the CSS height will do the trick, however, it works only with the first table in the body each with a height of 100%. My issue is that the other nested tables for layout and images take on the height of the body table at time of render but do not dynamically...
1
1719
by: Krishna C | last post by:
what is the difference b/w VARRAY,RecordType,table type and nested tables data types?
0
9706
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
9579
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
10326
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
10075
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
9143
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...
0
5520
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
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4295
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
3815
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.