I'm a Sri Lankan student who came to study in Spain, but I"m here not with student visa, but Schengan visa ( a mistake happen in first place). my visa expires at 12th of Dec, but I have to Stay until end of January in Spain. since this is type C , spain embassy said I can not change it to type D being in a European country. Could you please tell me the options I have to get visa ( it's ok even to get the type C again ) from Dec to January without me going back to Sri Lanka and apply again. ( Sri Lanka doesnt have a spain embassy so I have to go to India , if I happen to go)
I'm sorry, but odds are you'll have to go back to Sri Lanka and apply for a new visa.
Except in "exceptional circumstances" (which means getting hit by a bus, not applying for the wrong visa), Schengen Type C short-stay visas cannot be extended beyond 90 days or converted into other visas.
The general rule is that new visas have to applied for in embassy closest to your place of residence, meaning New Delhi for Sri Lanka.
I would still talk to the place you are studying and see if they have any better ideas, since you're probably not the first in this situation.