It's all about the total amount of carbohydrates you eat, which includes sugars, but also anything that is starchy, like potatoes, corn, and grains. When people eat too many soft drinks, hamburgers, French fries, mac & cheese, candy, cakes, chips, pizza, etc. (all high carb) they get fat. The cells get so stuffed that they shut their receptors down so insulin can't stuff more sugar into their cells. So it piles up in the bloodstream, and then your doctor tells you that you have diabetes. It's usually a long-term, chronic bad eating habit, but it's hard to measure how much you have to eat to get to the point where your fasting blood sugars are above 120, or whatever they have set it now to declare that you officially have diabetes. The point is, if you eat a low carb diet, and cut out the bad fats (like animal fats, refined vegetable oil, canola oil, soy oil) you have a better chance of not getting diabetes. If you're wondering how much sugar you can get away with eating a day before you give yourself diabetes, you might measure your weight and compare it to a BMI chart. And check your blood sugar levels (with a cheap monitor from Walmart for about $20).
The idea that diabetes is genetic only connects if you consider what your parents and grandparents taught their kids about what to eat. Each generation educates the next on what good nutrition is. It isn't simply a genetic thing you re predisposed to and nothing you do is going to prevent you from getting diabetes. Diabetes is curable, when you eat the right thing and exercise gently (30 minute walk a day should do it).