To expand on that if you have purchase music on your iPad from iTunes Store follow these instructions. The MOST important thing to do on a new Mac or PC is authorize the computer. Donot sync the iPad as you will loose all your music on the iPad.
Connect your device to the computer. If it is synced with another iTunes library, the following must be done.
Authorize your computer before preceding to avoid any issues
Click the Transfer Purchases button.
iTunes will begin copying any purchases made with any account for which the computer is authorized.
Note if you have a large collection this will take time so be patient.
If when you connect your device you are not prompted by the dialog above, it could be that the option "Do not ask me again" was previously selected. Fortunately, there are two more ways you can copy your purchases from your device.
After connecting your device to the computer and its icon appears in iTunes, go to the File menu, then Devices, and choose Transfer Purchases from "(Your device name)".
Or, you can Show Sidebar from the View menu, and then right-click (Windows or Mac) or Control-click (Mac only) your device in the iTunes Source list, then choose Transfer Purchases from the shortcut menu that appears.
Please note that this feature works only for items that were purchased on the iTunes Store. Any items imported from audio CDs or acquired from other sources will not copy from your device to the iTunes library.