Melt butter in skillet, saute onion and green pepper. Add corn, sugar, salt and black pepper; stir well. Turn off heat and cool. Add chesse and eggs. Pour into buttered 2 quart casserol and place in pan of water in oven. Bake at 350 degrees for 35 minutes or until center is set.