Daughter in law asked a very good question about beans and gas. I do have an answer but let us digress a bit. When I was learning to cook and, that would have been high school home-ec, we were taught to soak the beans in baking soda. It turns out what that removed was a lot of the vitamins in the beans.
Now science has jumped forward and we can give some names to what happens with certain foods. There are several foods that are at fault, cabbage, onions, peas, soybeans and the other legumes. It's a carbohydrate, yes a sugar that is at fault, called raffinose sugars. oligosaccharides are the family of sugars this carbo comes from. Sadly our enzymes in the small intestine do not know how to brake up this sugar. All these carbohydrates can do is move through the small intestines into the large where bacteria, what ever is there at the time, takes over and that produces gas.
What can we do? There is a way to prepare the beans that removes a lot of this sugar, I will include it for you. This is how I prepare beans. I haven't had trouble with the canned beans so it maybe in how they were processed before canning. We eat tons of bean with no ill effect. Aside of preparations there is a product called Beano that really can help. They have made drops from an enzyme that will do what your small intestines aren't doing. Try it see what you think.
How to prepare beans for reducing gas gotten from the University of Washington (our local extension) can answer question about most any thing.
WASHINGTON STATE UNIVERSITY:Beans are full of starch including some that do not digest easily. Digesting this starch can produce gas, giving rise to the rhyme Beans, beans, the musical fruit.... There are several ways to quiet this music so you can enjoy the health benefits of beans.
Soak beans overnight then discard the soaking water. Some, but not all, of the hard-to-digest carbohydrates dissolve into the water and are then poured off.
This quick method also helps reduce gas: Cover beans with water. Bring to a boil for 2-3 minutes. Let set at least one hour, but preferably four hours. The longer beans soak, the more gas-causing substances are removed.
COOKING DRIED BEANS TIPS FOR PREVENTING GASCOLORADO STATE UNIVERSITY COOPERATIVE EXTENSION:
Dry beans also are easy to prepare. They have, however, gained a reputation for being hard to digest and are known to cause a little flatulence or "gas."
To help eliminate this problem, try cooking dried beans like this:Soak dried beans overnight or at least for five hours. (This isn't necessary for dried peas and lentils.) Discard the water, add fresh water, cook for half hour and discard the water. Rinse beans thoroughly until water runs clear. Cover with fresh water and cook until tender.
This method will help prevent "gas," which is caused by complex carbohydrates (raffinose sugars) that are not broken down in digestion. If you want to include more beans in your diet, but increase your "comfort zone" with them, you should: Start slowly by eating beans only a couple of times a week at first. This helps your body adjust to digesting them. Drink lots of fluids to help the digestive system handle the increased dietary fiber.
Soak and cook thoroughly to eliminate the raffinose sugars that make beans hard to digest. Other helpful hints for cooking beans are to add one tablespoon of oil to beans to keep the foam down while cooking. If your recipe calls for tomatoes, lemon juice, vinegar or other acidic foods, add these items after beans are tender. The presence of acid keeps beans from softening.