Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 16, 2012 10:34 AM by ramiramilu
Nov 15, 2012 06:30 PM|LINK
The internet is useless 50% of the time.
I have a Students tbl
A Join tbl
And a ParentGuardian tbl
Guru's, wise ones I beg you, I plead, please lead me to the knowledge that will allow me to build a web form for this.
I thank and wish that I could give whatever you desire.
Nov 15, 2012 07:09 PM|LINK
I would say you have to go long way..
First Start from the database structure.. There is no need of Join tbl PGStudents.. You can join the remaining two tables using inner join in sql..
Use the following Table Structure:
Field Datatype Constraint
StudentId int pk(Auto-Increment/Not-Null)
ParentId int pk(Auto-Increment/Not-Null)
Then next step is creating your webform..
Now For inserting Data in the Student table .. Create a page as InsertStudent.aspx.. In that include two textbox, two labels for inserting fname and lname and a button to submit the data..
Repeat the same for ParentGuardian table...
Now To display the data of the two tables use a gridview...
Nov 15, 2012 07:28 PM|LINK
Thank you for your prompt reply. The relationship is:
A student belongs to one or more Parents or Guardians
A Parents or Guardian can have one or more Students
This is indeed a many to many relationship necessitating a Join or Junction table for future queries such as:
1. Who are the children of a parent
2. Who are the parents of a student
3. How many students belong to a parent
and so on.
Nov 16, 2012 10:34 AM|LINK
learn more about LEFT JOIN - http://www.w3schools.com/sql/sql_join_left.asp
then you can merge the results and uyou can use Count(*) to get the counts....