public void selectID(LocationEquips locationEquips) { connection.open(); command = new SqlCommand("select ID from LocationEquips where locationID='" + locationEquips.getLocationID() + "'", connection.getConnection()); locationEquips.setID((int)command.ExecuteScalar()); connection.close(); }
public void selectLastID(LocationEquips locationEquips) { connection.open(); command = new SqlCommand("select TOP 1 ID from LocationEquips ORDER BY ID DESC", connection.getConnection()); locationEquips.setID((int)command.ExecuteScalar()); connection.close(); }