Using(BachtuocvnDataContext bt = new BachtuocvnDataContext() ) { Bet_Leagues_Teams matchedTeam = bt. Bet_Leagues_Teams. Where(lt => lt.
LeagueID == leagueID) .SingleOrDefault(); if(matchedTeam! = null) { matchedTeam. TeamID = teamID; bt.
SubmitChanges(ConflictMode. ContinueOnClonflict); } }.
Using( var bt = new BachtuocvnDataContext() ) { var matchedTeam = bt. Bet_Leagues_Teams. Single( lt => lt.
LeagueID == leagueID ); matchedTeam. TeamID = teamID; bt. SubmitChanges( ConflictMode.
ContinueOnClonflict ); }.
It does not work ... – Vimvq1987 Aug 9 '10 at 15:08 Sorry, its essentially the same as your example after your edit. – Jerod Houghtelling Aug 9 '10 at 15:09.
Note that Single() will throw an exception if there is more than one matching elements (which, if your schemea models the concept of "league" properly, there will be) You may want to use First() there.
You hve to attach the entity first to your DataContext, because the modelbinder of the MVC framework just creates a new instance of that class to pass the form data to your action. By setting the second parameter to true, you tell L2S that the entity is in modified state, but that only works when you have a timestamp member for version checking on your entity. The simplest approach wiould be to attach as unmodified and then call Refresh.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.