When Al-Biruni came to India?

When Al-Biruni came to India?A. 1005
B. 1016
C. 1017
D. 1018

In 1017, Al-Biruni was taken to Ghazna, by Mahmud Ghaznavi. Biruni was made court astrologe. After Indian invasion; he was sent to India, for a few years. where Biruni became familiar with all things related to India, even Sanskrit.