By the few months I was trying to do an application using Sql Server + C#. The program is a kind of “Pokémon Agenda”, where a user can add and edit pokémons and their abilities, types and photo, besides other functions like searching for records. Here’s a print screen from the Form and from the tables diagram:


Here’s my problem: I was trying to access directly the names from the tables “Abilities” and “Types” by only using its ID’s (AbilityID and TypeID) from the table “Kanto”. In other words, I was trying to access many data from different tables using, basically, just one table! However, I am not sure if this is exactly possible.
I thought in 2 possibilities:
-
Using Dataset relations (although this solution is not too clear for me yet), for example:
ds.Relations.Add(“PokéAbility”, ds.Tables[“Abilities”].Columns[“AbilityID”], ds.Tables[“Kanto”].Columns[“AbilityID”]);
-
Using a Natural Join, so I could create more tables and use them too to manipulate my desired data.
Note: the tables “Types” and “Abilities” should be already filled with all the necessary information, so they won’t be edited during the execution of the Form.
I won’t paste the whole code because it is a little long, but, if you would like to see a specific part of it, just ask me that I will provide it.
This should create a consolidated view. I’ve not tested the SQL so there might be a typo. This should get you started. You need to understand views and also joins.