Preheat oven to 350°. Layer first six ingredients in a greased 13×9-inch baking dish.
In a large bowl, whisk flour, eggs and milk until smooth. Add corn, salt and pepper; mix well. Pour over top; let stand 15 minutes. Dot with butter and sprinkle with pecans.
Cover and bake 35 minutes. Uncover and bake 30-35 minutes or until a knife inserted near the center comes out clean.