Cold approach or build rapport?

Like say i approach a girl, should i straight up try to get the number or build it up first after i see a girl a couple of times and things feel right then get the number?

So the college where I am is quite small, usually see the same faces everyday and actually did cold approaches a few times last year and got one number. The ones who rejected me usually were always looking at me together with her friends when i walked by, probably labeling me as 'that guy' and maybe even spread it all around.

To get to the topic again, cold approach or building a connection first before going for the number?