By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,900 Members | 1,078 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,900 IT Pros & Developers. It's quick & easy.

What is the best way to display data from a previous form

P: n/a
Hello,

Windows forms & database

What are the considerations when choosing how to display reference
information from the calling form? What is recommended?

Table1 is the parent of Table2.

Form1 allows data entry into Table1.
Form2 allows data entry into Table2.

Form1 (the parent) opens Form2 (the child)

I need to display six fields from the parent table or form.

I see my options as...

1.) Populate the child form from a stored procedure that uses a SQL
Server View that contains a relationship between the two tables. Supply
the PK of the parent as the parameter for the stored procedure used to
populate the child.

2.) Open the child form as ShowDialog from Form1 and hide rather than
close Form1. Open Form2 by calling a simple stored procedure that
reference only the child table supply the PK of the parent as the
parameter to filter the child table. Get the six reference fields
through the use of public fields or public properties.

There are other options but I believe the two above are better. Which
is the best and what are the considerations in choosing.

I favor #1 but have not worked with views and have reservations about
how to proceed.

Thank you,
dbuchanan

Nov 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi,

"dbuchanan" <db*********@hotmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Hello,

Windows forms & database

What are the considerations when choosing how to display reference
information from the calling form? What is recommended?

Table1 is the parent of Table2.

Form1 allows data entry into Table1.
Form2 allows data entry into Table2.

Form1 (the parent) opens Form2 (the child)

I need to display six fields from the parent table or form.

I see my options as...

1.) Populate the child form from a stored procedure that uses a SQL
Server View that contains a relationship between the two tables. Supply
the PK of the parent as the parameter for the stored procedure used to
populate the child.
Keep in mind, if you do a join then then the view will end up in one
DataTable, you'll also have redundant information since each child row also
contains the parent row data.

2.) Open the child form as ShowDialog from Form1 and hide rather than
close Form1. Open Form2 by calling a simple stored procedure that
reference only the child table supply the PK of the parent as the
parameter to filter the child table. Get the six reference fields
through the use of public fields or public properties.
If you are planning on closing Form1, then you could copy the parent DataRow
while passing it to Form2 before showing it. Then you fill the child
DataTable by a simple stored procedure.

Or just could pass Form1's DataSet to Form2 if it contains a parent
DataTable with one DataRow and an empty child DataTable.

HTH,
Geetings


There are other options but I believe the two above are better. Which
is the best and what are the considerations in choosing.

I favor #1 but have not worked with views and have reservations about
how to proceed.

Thank you,
dbuchanan

Nov 23 '05 #2

P: n/a
I can see that you are using .Net and VB..

1- you can pass the Datarow from Form1 to Form2 and so on if u need to pass
data for more forms..

2- I better recommend you use Microsoft User Interface Process (UIP)
Application Block.
http://msdn.microsoft.com/library/en...html/uipab.asp
"dbuchanan" <db*********@hotmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Hello,

Windows forms & database

What are the considerations when choosing how to display reference
information from the calling form? What is recommended?

Table1 is the parent of Table2.

Form1 allows data entry into Table1.
Form2 allows data entry into Table2.

Form1 (the parent) opens Form2 (the child)

I need to display six fields from the parent table or form.

I see my options as...

1.) Populate the child form from a stored procedure that uses a SQL
Server View that contains a relationship between the two tables. Supply
the PK of the parent as the parameter for the stored procedure used to
populate the child.

2.) Open the child form as ShowDialog from Form1 and hide rather than
close Form1. Open Form2 by calling a simple stored procedure that
reference only the child table supply the PK of the parent as the
parameter to filter the child table. Get the six reference fields
through the use of public fields or public properties.

There are other options but I believe the two above are better. Which
is the best and what are the considerations in choosing.

I favor #1 but have not worked with views and have reservations about
how to proceed.

Thank you,
dbuchanan

Nov 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.