The edible cucurbits that we grow in our edible garden, namely, pumpkins, luffas, cucumbers, rockmelons, watermelons and various squashes, have unisexual flowers where the male and female flowers occur separately on the same plant and the term “monoecious” is used to describe this phenomenon.
The sexes of cucurbit flowers are quite easy to tell apart. Female flowers have an obvious baby fruit behind the petals whereas you don’t find any behind the petals of the male flower. This is the description that I have often used to tell visitors as well as my gardeners in the community garden.
In the lowland tropics, pollination of cucurbit flowers that open during daytime should not be a problem since insects such as bees will automatically visit the flowers and help transfer the pollen.
If you face problems with fruit set, your plants may need your help to assist in the pollination of the flowers they produce. Here’s a step-by-step guide as to how you can play the role of the matchmaker… In this example, I am using the flowers of the cucumber.

The male flower of the cucumber - there isn’t a baby fruit behind the petals.

Once you have identified a male flower, pluck it off the vine and strip off all its petals.

Here’s a picture of a female cucumber flower. Notice there is a baby fruit behind the petals. To pollinate the female flower, lightly brush the pollen laden anthers of the male flower with the pistil of the female flower. In doing so, you transfer the pollen from the male flower to the female flower.

Once pollination is successful, the female flower will wilter and develop into the cucumber fruit.
I live in colorado springs, CO.
I have found a way to pollinate my cucumber plants!!!!!
I was at a park with my family and we sat under a pavillion that had a trash can close by. I kept having to get up and away because of all the BEES!!! bingo!!! I thought about how to bring that kind of smell to my garden with out having my trash can out for all to see. so as I was opening up a can of dog food to feed the dogs I said to myself, “self, I could put the empty can of dog food out next to my plants with out the neighbors seeing it!” I put it next to the plant with out washing the remaining dog food residue out of the can and waited. in just about a week of putting out new dog food cans and removing the dried up ones I now have 7, that’s right 7 cucumbers on ONE branch. almost every flower has been pollinated!!!!!!!!!!! I can’t belive that it worked!!!! by next week I will have about a cucumber every three days or so!!!!! try it and I bet it will work for you!!!!!!!!!
Bees and wasps( (all varieties) are very different critters, and I think you may be experiencing a coincidence. Wasps eat meat as well as sweet things, and would be attracted to trash cans and dog food, but they do not pollinate flowers.
Bees are attracted only to flower nectar and very sweet things that they can make honey out of, like soda pop or rotting fruit, and do pollinate flowers. You might have attracted wasps (yellow jackets are commonly mistaken for bees) with a dog food can, but they would not have been interested in the flowers.
Perhaps your cukes finally produced male and female flowers at the same time, or the bees just discovered them on their own. However it happened, congrats on your cukes!