Svekke
Member
- Joined
- Jul 27, 2010
- Messages
- 14
- Programming Experience
- Beginner
Dear experts,
I'm currently creating a windows form application to automate the calculation of prognostics for football events (WC, EC, ...).
I've already created the database
(Players, Stadia, Teams, Coaches, ...)
I've also created a working back-end for the COACHES table. I can update, delete, insert, ... coaches using the form. The database that is connected is an access 2007 database. I don't use stored procedures, I use hard-coded sql statements in my presentation layer ( I know this is not the best way to do this ,but I couldn't get it to work with 3 layers ).
Currently, I'm creating the 'PLAYER' backend. Every player has a "TEAMID" in its database (which is a foreign key linking to the TEAM table). I can insert, update, ... players if I fill in a number myself.
Here is the situation of this page:
In the left corner, I have a button 'GET ALL PLAYERS' which fills a datagridview with the information about the players. I also have some textboxes to the right, which show the details of the item selected in the datagridview (and which are used to update a record)
Now here is the problem: my TEAMID is shown as a number. This number can be updated, but it's not very usefull to just fill in a number. I would like to see the teamname instead.
1) How can I display the TEAM NAME in the datagridview, instead of the ID? (this comes from another table, should I create extra datatables, data-adapters, ...?
2) How can I update the player's team? Instead of just filling in a number, I want to display the team name (e.g.: in a listbox of something like that), so the person updating the record can select the team name in a list, but the ID is stored in the PLAYERS table.
I'm really a newbie in VB.NET, I know the basics. I tried searching the forum for an answer to this, but I could only find some general info which I also found on Google, but it doesn't really answer my specific question.
Thanks in advance
(editor = Visual Studio 2010)
(I could post some of my code I you like)
I'm currently creating a windows form application to automate the calculation of prognostics for football events (WC, EC, ...).
I've already created the database
(Players, Stadia, Teams, Coaches, ...)
I've also created a working back-end for the COACHES table. I can update, delete, insert, ... coaches using the form. The database that is connected is an access 2007 database. I don't use stored procedures, I use hard-coded sql statements in my presentation layer ( I know this is not the best way to do this ,but I couldn't get it to work with 3 layers ).
Currently, I'm creating the 'PLAYER' backend. Every player has a "TEAMID" in its database (which is a foreign key linking to the TEAM table). I can insert, update, ... players if I fill in a number myself.
Here is the situation of this page:
In the left corner, I have a button 'GET ALL PLAYERS' which fills a datagridview with the information about the players. I also have some textboxes to the right, which show the details of the item selected in the datagridview (and which are used to update a record)
Now here is the problem: my TEAMID is shown as a number. This number can be updated, but it's not very usefull to just fill in a number. I would like to see the teamname instead.
1) How can I display the TEAM NAME in the datagridview, instead of the ID? (this comes from another table, should I create extra datatables, data-adapters, ...?
2) How can I update the player's team? Instead of just filling in a number, I want to display the team name (e.g.: in a listbox of something like that), so the person updating the record can select the team name in a list, but the ID is stored in the PLAYERS table.
I'm really a newbie in VB.NET, I know the basics. I tried searching the forum for an answer to this, but I could only find some general info which I also found on Google, but it doesn't really answer my specific question.
Thanks in advance
(editor = Visual Studio 2010)
(I could post some of my code I you like)