They will grant only the residence permit if you can demonstrate that you will return to your home country after completing your education. You cannot work with this permit, as it is valid for the duration of your studies.