Tutorial on many-to-many relations DB in VB.net
Posted: Wed Jun 15, 2011 10:12 pm
Hey there....
ok .. i give up
well.. not quite, but i am trying to wrap my head around using databases in VB.net .. and i know how to instansiate a DB .. make it a part of the project... i know how to make tables.... i even know how to make relations between tables .. BUT .... i cant figure out "many-to-many" relations and how to dislay this on forms
i know that you need 3 tables for this .. and you need the two original tables, and they need have a primary key .. and the joining table (in the middle, in terms of relations) has to have its own primary key AND the foreign key of the other two tables.. so fare soo good
I am trying to make a training program simular to the illustrations i made for this question (this is not a actual database i have yet.... illustrations is just made in photoshop)
.... so i got the database schematics pinned down i think ..
But i cant figure out how to make VB.net do this :
1. on the "individual training log" form show all training sessions the person has ever attended (ex. John) .. including the specific equipment he used for each individual training session
2. on the "training session" form show all available persons from "individual training log" in ex. a listbox
3. and when their name is dragged onto the picked training equipment for the day .. save that information into the gridview below .. which then again will be reflected back to the"individual training log" form - so that the individual person can see which equipment he used at each training session
so basically what im asking for, is a tutorial on, "many to many relational DB'ing in vb.net ... including the tricky part ... pulling information from the different database tables (see attachment) .. and displaying it on forms"
it is NOT important to include all the "person details" for each individual in the tutorial .. the important stuff is to show how to make the relations work .. and display of data related to these relations
if anyone would find it interessting to make such a tutorial .. i am eternally greatfull .. and im sure im not the only one struggling with "many to many " relations :-)
Thank you for the time you spend reading this
Im new at this .. but i find it soo interresting that sometimes i even dream in code
New Guy :-)
ok .. i give up

i know that you need 3 tables for this .. and you need the two original tables, and they need have a primary key .. and the joining table (in the middle, in terms of relations) has to have its own primary key AND the foreign key of the other two tables.. so fare soo good
I am trying to make a training program simular to the illustrations i made for this question (this is not a actual database i have yet.... illustrations is just made in photoshop)

.... so i got the database schematics pinned down i think ..
But i cant figure out how to make VB.net do this :
1. on the "individual training log" form show all training sessions the person has ever attended (ex. John) .. including the specific equipment he used for each individual training session
2. on the "training session" form show all available persons from "individual training log" in ex. a listbox
3. and when their name is dragged onto the picked training equipment for the day .. save that information into the gridview below .. which then again will be reflected back to the"individual training log" form - so that the individual person can see which equipment he used at each training session
so basically what im asking for, is a tutorial on, "many to many relational DB'ing in vb.net ... including the tricky part ... pulling information from the different database tables (see attachment) .. and displaying it on forms"
it is NOT important to include all the "person details" for each individual in the tutorial .. the important stuff is to show how to make the relations work .. and display of data related to these relations
if anyone would find it interessting to make such a tutorial .. i am eternally greatfull .. and im sure im not the only one struggling with "many to many " relations :-)
Thank you for the time you spend reading this
Im new at this .. but i find it soo interresting that sometimes i even dream in code

New Guy :-)