There's this common folk belief about type 2 diabetes that it's caused by eating too much sugar, but afaict that's not the mainstream view among people who actually research it. The mainstream view is that it's caused by excess calories, fat (especially visceral fat), and genetics.