Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // VRÁTÍ SEZNAM VŠECH HRÁČŮ HRAJÍCÍCH V DANÉM ZÁPASE
- public List<Models.Player> getPlayersByMatch(string matchID)
- {
- List<Models.Player> tempList = new List<Models.Player>();
- SqlDataReader myReader = null;
- string commandText = "SELECT playerID, teamID, fname, lname FROM Player JOIN [Player-Match] ON Player.playerID = [Player-Match].Player_playerID WHERE Match_matchID = @matchID";
- using (SqlConnection conn = base.NewConnection())
- {
- conn.Open();
- myCommand = new SqlCommand(commandText, conn);
- myCommand.Parameters.AddWithValue("@matchID", matchID);
- myReader = myCommand.ExecuteReader();
- while (myReader.Read())
- {
- tempList.Add(new Models.Player(myReader[0].ToString(), myReader[1].ToString(), myReader[2].ToString(), myReader[3].ToString(), null, null, null, null, null, null, null, null));
- }
- myReader.Close();
- conn.Close();
- return tempList;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment