As Wammers said, first check battery & alternator. As well as the connections to the gearbox ECU, check the loom and connector to the box itself and the big connector between the underbonnet fuse box and the brake pump, also the earth strap from the engine to the chassis.