473,545 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Header Detail Example


I want to relate 2 tables in Access or SQL for a one to many. I would
like to find an example in .Net for data entry for this structure. For
example, I would like customer info at the top of the page and customer
history at the bottom. Maybe the details section can be in a editable
grid control and the customer header can be just form controls. Is there
any known code samples for what I'm trying to do?

Code examples appreciated. Thanks.
Frank

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
1 1556
I think what you want is to insert the child data, with the primary ID from
the parent table.

Parent table:

ParentID Name FName

Child Table:

ID Address ParentID

Child Table 2

ID PhoneNumbers ParentID

You would perform an InsertStatment like This:

INSERT INTO ParentTable (name,Fname) VALUES

DECLARE @pid as int
SELECT @pid=@@IDENTITY -- there are better ways of doing this, for example
row locking

--- Now insert into child tables

INSERT INTO Child1 (address, parentid) VALUES('',@pid)
INSERT INTO Child1 (PhoneNumbers, parentid) VALUES('',@pid)


"Frank Py" <fp*@proactnet. com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..

I want to relate 2 tables in Access or SQL for a one to many. I would
like to find an example in .Net for data entry for this structure. For
example, I would like customer info at the top of the page and customer
history at the bottom. Maybe the details section can be in a editable
grid control and the customer header can be just form controls. Is there
any known code samples for what I'm trying to do?

Code examples appreciated. Thanks.
Frank

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

Nov 18 '05 #2

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

Similar topics

3
3824
by: dont bother | last post by:
Hi, I have written this small piece of code. I am a brand new player of Python. I had asked some people for help, unfortunately not many helped. Here is the code I have: import email import os import sys fread = open('email_message', 'r')
2
5926
by: Simone | last post by:
Hello. I am using the code below: ------------------------------------------- Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If Me.Section(0).BackColor = vbWhite Then Me.Section(0).BackColor = 15724527 Else Me.Section(0).BackColor = vbWhite End If
6
38278
by: Chuck | last post by:
I have a report with three columns, accross then down, and two groups. Currently the group headers are only one column wide and appear in the left hand column. How can I make the group header be centered accross all columns? Chuck ....
2
3373
by: Ross Hamilton | last post by:
Can anyone help me with this small problem. I have a report that is divided into 3 Columns using the page setup, It displays the report fields in 3 separate columns (Desc & Pg Num) but it only displays the Page Header on the first column. Any thoughts?? regards,
1
7308
by: David Horowitz | last post by:
Hi folks. I need to create a report that has a Group Header that pulls certain data from the Detail section. It's something like this: +--Report---------------------------------------- | +--Group Header---------------------------------- | | Codes: XYZ, XXX, YYY
4
5914
by: 2D Rick | last post by:
In Access2003 and XP. My forms detail section hides behind the header when I scroll down to see controls off screen. This is similar to freezing a pane in Excel. I'd rather this did not happen but can't find the property that controls this. When the form first opens some of the controls are behind the header and scrolling is required to see...
0
1691
by: Arnold | last post by:
Hi Everyone; In a report, I've essentially recreated a paper sheet by adding various labels--name, date, problem, year, Progress Notes, etc.--and horizontal lines (people have traditionally written notes). I made all of these in the Page Header section. By the way, this is a report form to track the daily progress of students. --Report...
1
2796
by: jdicko5579 | last post by:
Hello: I am fairly new to Access and was wondering if someone could help me out. I have a main form with header. In the detail section of the main form, there is a subform. The subform has a header and a detail section. I am not able to tab from the last record in the main form's header to the header of the subform. Also, I am not able to...
4
3911
by: DavidB | last post by:
Im not sure if I am missing something obvious here or not so excuse me if this is a DFU question please... I have a report I am working on that includes the following data. Agency Name Vendor Name Contract Number Contract Description Agencies can have (and often do have) multiple contracts. I want my
8
1655
by: JRough | last post by:
What is the purpose of caching in the header below? I used something like this for downloading a detail page to Excel but in this example it looks like it is for cache control? Why would you expire a header? So the user couldn't send a request after too long of a period for example in the downloaded excel page? <?php header("Expires:...
0
7410
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...
0
7668
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. ...
0
7923
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...
0
5984
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...
1
5343
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...
0
3448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1901
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
1
1025
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
722
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.