I was having this problem too. If you go to Settings>Wireless & Networks Scroll down to Mobile Network make sure its checked and says connected. For some reason mine was checked but kept coming up with a connection error. I just unchecked it and rechecked it now it says connected.
Also if you go to Mobile Networks and Access Point Names make sure that you are on T-Mobile Data and not TelKila. I have seen a friends phone that kept trying to switch to the Telkila network and it messed up his data.