/* ******************************************************* * */ private void LoadPositionPairs() { var idToPosition = new Dictionary <int, string>(); var positionToId = new Dictionary <string, int>(); using (var cmd = new SqlCmdExt(_connectionString)) { cmd.CreateCmd(@" SELECT Id, Position FROM Position "); cmd.ExecuteSelect(); while (cmd.Read()) { var id = cmd.GetInt("Id"); var position = cmd.GetString("Position"); idToPosition.Add(id, position); positionToId.Add(position, id); } } _idToPosition = idToPosition; _positionToId = positionToId; }
private void LoadHandednessPairs() { var idToHandedness = new Dictionary <int, string>(); var handednessToId = new Dictionary <string, int>(); using (var cmd = new SqlCmdExt(_connectionString)) { cmd.CreateCmd(@" SELECT Id, Hand FROM Handedness "); cmd.ExecuteSelect(); while (cmd.Read()) { var id = cmd.GetInt("Id"); var hand = cmd.GetString("Hand"); idToHandedness.Add(id, hand); handednessToId.Add(hand, id); } } _idToHandedness = idToHandedness; _handednessToId = handednessToId; }
private SqlCmdExt Select(string command) { var cmd = new SqlCmdExt(_connectionString); cmd.CreateCmd(command); cmd.ExecuteSelect(); return(cmd); }