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

One to many relationships on webforms

I am very new to .net and asp.net. I am trying to design an intranet page
that has a SQL Server 2000 database. I understand how to connect to the data
but am getting very confused on how to display, update and modify data in a
one to many relationship.

Is there any resource available that can show me how a web form looks when
the data is in a one to many relationship.

I've done work in MS Access and it was very easy using sub forms but I am
now lost trying to figure out how this should be done in ASP.NET using Visual
Studio 2003.

any help would be greatly appreciated. Thanks.
Mar 13 '06 #1
5 2965
A one-to-many relationship is a database relationship, which relates a
unique key column in one table to a foreign key column in another, in such a
way that there may be many records in the table with the foreign key that
relate to a single record in the table with the unique key.

That said, how one works with the data is determined largely by what one
wants to do with the data. One-to-many relationships have a number of uses,
and the development solution for each use is different.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

"Robert" <Ro****@discussions.microsoft.com> wrote in message
news:A1**********************************@microsof t.com...
I am very new to .net and asp.net. I am trying to design an intranet page
that has a SQL Server 2000 database. I understand how to connect to the
data
but am getting very confused on how to display, update and modify data in
a
one to many relationship.

Is there any resource available that can show me how a web form looks when
the data is in a one to many relationship.

I've done work in MS Access and it was very easy using sub forms but I am
now lost trying to figure out how this should be done in ASP.NET using
Visual
Studio 2003.

any help would be greatly appreciated. Thanks.

Mar 14 '06 #2
Thanks for replying but I do understand what a one-to-many relationship is in
SQL. What I don't understand is how to display this in a web form. When I
create a form in MS Access it was very easy in that I drop a sub form on a
main form and link the keys. This is not possible in a web form. Let's say
for example I am creating a web form that is to display Patient information.
Each patient has a unique number that defines them but there is another
unique number that explains each time a patient visits a doctor. How would I
display the patient information on a web form but also display all the visits
also?

"Kevin Spencer" wrote:
A one-to-many relationship is a database relationship, which relates a
unique key column in one table to a foreign key column in another, in such a
way that there may be many records in the table with the foreign key that
relate to a single record in the table with the unique key.

That said, how one works with the data is determined largely by what one
wants to do with the data. One-to-many relationships have a number of uses,
and the development solution for each use is different.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

"Robert" <Ro****@discussions.microsoft.com> wrote in message
news:A1**********************************@microsof t.com...
I am very new to .net and asp.net. I am trying to design an intranet page
that has a SQL Server 2000 database. I understand how to connect to the
data
but am getting very confused on how to display, update and modify data in
a
one to many relationship.

Is there any resource available that can show me how a web form looks when
the data is in a one to many relationship.

I've done work in MS Access and it was very easy using sub forms but I am
now lost trying to figure out how this should be done in ASP.NET using
Visual
Studio 2003.

any help would be greatly appreciated. Thanks.


Mar 14 '06 #3
You can use the new data aware components (Gridview, DetailsView, FormView)
in conjunction with the new TableAdapters, DataSets and DataSources
(ObjectDatasource, SQLDataSource).

It's a bit long winded, but basically you can get your master data in a
GridView, then use a DetailsView to act as the "Many" - you can link them us
so that when you select a record in the GridView, the details view shows the
detail records.

You can set your tableadapters up so that you can select and update the
records from within this.

Best bet is to looks for some tutorials or helpful sites on these components
(there are loads of them) - Microsoft has some really helpful videos which
you can download (i've lost the link so you'll have to search).

Will
"Robert" <Ro****@discussions.microsoft.com> wrote in message
news:A1**********************************@microsof t.com...
I am very new to .net and asp.net. I am trying to design an intranet page
that has a SQL Server 2000 database. I understand how to connect to the
data
but am getting very confused on how to display, update and modify data in
a
one to many relationship.

Is there any resource available that can show me how a web form looks when
the data is in a one to many relationship.

I've done work in MS Access and it was very easy using sub forms but I am
now lost trying to figure out how this should be done in ASP.NET using
Visual
Studio 2003.

any help would be greatly appreciated. Thanks.

Mar 14 '06 #4
Hi Robert,

When I'm not sure about what is known and what is not, I tend to go over
what may already be known. In this case, it was an introduction to the
answer. What you are talking about is known as a "master-detail" view of
data, in which the child table is displayed, and when a record in the child
table is selected, the parent table record corresponding to that child table
is displayed in a separate view.

In addition, what you're talking about is custom programming. Will
Buchanan's remarks are on-target. The only way to do this is to build it
yourself, using ASP or ASP.Net.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

"Robert" <Ro****@discussions.microsoft.com> wrote in message
news:D9**********************************@microsof t.com...
Thanks for replying but I do understand what a one-to-many relationship is
in
SQL. What I don't understand is how to display this in a web form. When
I
create a form in MS Access it was very easy in that I drop a sub form on a
main form and link the keys. This is not possible in a web form. Let's
say
for example I am creating a web form that is to display Patient
information.
Each patient has a unique number that defines them but there is another
unique number that explains each time a patient visits a doctor. How
would I
display the patient information on a web form but also display all the
visits
also?

"Kevin Spencer" wrote:
A one-to-many relationship is a database relationship, which relates a
unique key column in one table to a foreign key column in another, in
such a
way that there may be many records in the table with the foreign key that
relate to a single record in the table with the unique key.

That said, how one works with the data is determined largely by what one
wants to do with the data. One-to-many relationships have a number of
uses,
and the development solution for each use is different.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

"Robert" <Ro****@discussions.microsoft.com> wrote in message
news:A1**********************************@microsof t.com...
>I am very new to .net and asp.net. I am trying to design an intranet
>page
> that has a SQL Server 2000 database. I understand how to connect to
> the
> data
> but am getting very confused on how to display, update and modify data
> in
> a
> one to many relationship.
>
> Is there any resource available that can show me how a web form looks
> when
> the data is in a one to many relationship.
>
> I've done work in MS Access and it was very easy using sub forms but I
> am
> now lost trying to figure out how this should be done in ASP.NET using
> Visual
> Studio 2003.
>
> any help would be greatly appreciated. Thanks.


Mar 14 '06 #5
Oops, sorry, I forgot that I was currently on the ASP.Net newsgroup. Here's
a couple of references for you:

http://www.dotnetjohn.com/articles.aspx?articleid=14
http://www.c-sharpcorner.com/asp/Art...DetailDCHK.asp
http://aspnet.4guysfromrolla.com/articles/040203-1.aspx
http://www.codeproject.com/aspnet/masterdetailgrid.asp

Again, sorry about the confusion. I hope this gets you going!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.
"Robert" <Ro****@discussions.microsoft.com> wrote in message
news:D9**********************************@microsof t.com...
Thanks for replying but I do understand what a one-to-many relationship is
in
SQL. What I don't understand is how to display this in a web form. When
I
create a form in MS Access it was very easy in that I drop a sub form on a
main form and link the keys. This is not possible in a web form. Let's
say
for example I am creating a web form that is to display Patient
information.
Each patient has a unique number that defines them but there is another
unique number that explains each time a patient visits a doctor. How
would I
display the patient information on a web form but also display all the
visits
also?

"Kevin Spencer" wrote:
A one-to-many relationship is a database relationship, which relates a
unique key column in one table to a foreign key column in another, in
such a
way that there may be many records in the table with the foreign key that
relate to a single record in the table with the unique key.

That said, how one works with the data is determined largely by what one
wants to do with the data. One-to-many relationships have a number of
uses,
and the development solution for each use is different.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

"Robert" <Ro****@discussions.microsoft.com> wrote in message
news:A1**********************************@microsof t.com...
>I am very new to .net and asp.net. I am trying to design an intranet
>page
> that has a SQL Server 2000 database. I understand how to connect to
> the
> data
> but am getting very confused on how to display, update and modify data
> in
> a
> one to many relationship.
>
> Is there any resource available that can show me how a web form looks
> when
> the data is in a one to many relationship.
>
> I've done work in MS Access and it was very easy using sub forms but I
> am
> now lost trying to figure out how this should be done in ASP.NET using
> Visual
> Studio 2003.
>
> any help would be greatly appreciated. Thanks.


Mar 14 '06 #6

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

Similar topics

2
by: MRG | last post by:
I have a geographic points table containing point records with latitude and longitude points. I also have several other tables containing entities that will relate to points in the points table,...
4
by: H Cohen | last post by:
Hi, I have a corporate database with about 60 different tables that spans manufacturing, accounting, marketing, etc. It is possible, but unwieldy, to establish a relationship for each table...
2
by: Megan | last post by:
hello everybody, i know this is a very long post, but i wanted to provide as much detail as possible. quick overview- i want to create a couple of many to many relationships and am wondering...
1
by: Johnny Meredith | last post by:
Hi, I'm building a database that, once a year, generates surveys that are emailed to people in our organization. The recipients of the surveys are managers of various departments. The emails...
2
by: ronenkf | last post by:
I am currently working on access 2003. Created database with 4 tables. For each on e there is a primary key, which is a text data type. Now I'm trying to configure relationship between tables. The...
13
by: the other john | last post by:
The trouble currently with 3 tables. I'm excluding non-relevant fields... tbl_users PK_user_ID tbl_developers PK_developer_ID FK_developer_user_ID FK_developer_project_ID
14
by: Jeff | last post by:
This is the first time that I remember ever having too many indexes on a table, but it has happened. I have en employees table and store in many places, on tables, the id of the employee that...
6
by: Tazzy via AccessMonster.com | last post by:
Hi all, I'm in the process of setting up a database for a project that involves actors, shows and venues and have set up tables as follows; TblActors - Stage name(Primary key), real name, etc....
22
by: banderson | last post by:
Hello I'm new to developing databases in Access and using Access2003. I have a dataset with a few many to many relationships that I have created linking tables for to make multiple 1:M relationships....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.