Last post Nov 11, 2015 10:43 PM by buckd30
Nov 11, 2015 06:28 AM|buckd30|LINK
I have a table called players in which many players our part of a team my deletion of teams are working spot on but my delations of player are not hapening for some reason.
public IQueryable<player> getAllPlayers()
var _player = SoccerEntities.players.ToList();
Above is how I am filling the grid and on my delete i am doing the following
if (e.CommandName == "Delete")
GridDataItem item = e.Item as GridDataItem;
Guid strId = new Guid(item.GetDataKeyValue("id").ToString());
player _player = _dal.GetPlayerBYID(strId);
Is thier anything in my foreign key setup that is refusing me the right to delete i get no error just nothing deleted.
This is the actual foreign key which is not allowing me to delete a player but a delation from teams is ok
Nov 11, 2015 09:18 PM|Zhi Lv - MSFT|LINK
As for this issue, I suggest you check the nextPlayerID and player_points table. I suppose perhaps the player id is a foreign key in these tables. If that is the case, before you delete the player, you need to delete the relevant records in these tables.
Here are some relevant articles, you could check them:
Nov 11, 2015 10:43 PM|buckd30|LINK
No they are not to do with a foreign key to those tables next id talbe is just that used for player number in a funciton and player _points is not relatied at all
so your in correct its something to do wit the foreign key in that talbe of player !.