Visual Studio 2012 VB.net
Some time back when I started to learn Visual Studio 2005 Beth Massi showed how to bind a textbox with IntegerId to the actual name of the person the id refers to. She did this by dragging the person's FullName datafield onto the PersonIdTextbox.
This would, of course, apply to PersonId in a second table such as a TeamCaptain who is also part of the TeamMembers table.
For example, let's use the following tables in GameScheduleDatabase along with the GameScheduleDataset:
Table 1 contains all the members of the League.
Table Name: TeamMembers
[MemberId] integer Not null,
[MemberFirst] nvarChar Not null,
[MemberLast] nvarChar Not null,
[FullName] AS (([Last]+', ')+[First]) PERSISTED NOT NULL,
[Team] tinyint Not null -From TeamId in TeamCaptains table
Table 2 contains the names of the team captains and their assistants
Table Name: TeamCaptains -- each captain is also part of the TeamMember table
[TeamId] tinyint Not Null, -Primary key
[TeamCaptain] integer Not Null, -from MemberId in TeamMembers table
[Assistant] integer Not Null -from MemberId in TeamMembers table
The TeamCaptains form contains the TeamCaptains (detail view) along with all the Members of the team (gridview) Works great with no problem.
Now to the problem. The TeamCaptains field textboxes only show integers. According to What I understood from Beth Massi, I should have been able to drag the FullName identifier field onto the TeamCaptainTextbox and the AssistantTextbox, and the proper name should replace the integer.
It only sort of works.
For example:
Captain John Smith - MemberId 35, is captain and member of team 2.
Pocohantis - MemberId 23 also belongs to team 2. Since she is the first one in the TeamMembers table who belongs to team 2, she is the one that shows in the TeamCaptain textbox. If I add another textbox reflecting the actual MemberId, it still reads 35.
I realize of course, that I can do this programmatically using another textbox bound to the TeamMemberId, and it is simple. Nevertheless, I thought it could be done right in the IDE without any programming whatsoever.
I have accomplished it before, and the program I wrote still works, but I can't get it to work properly here. I have never been able to do it with a gridview, so any help here would also be appreciated.
I hope this is a clear question. I've researched everything I can think of, and can't find the solution.
Thank you all for help.