Never Ask for a Phone Number
You don't ever want to ASK for a number; you appear as though the answer might be "No." You need to appear as though you naturally assume the answer is "Yes."
Asking "What is your phone number?" is definitely better than "Can I have your number?"
The most effective line I've come across is "Why don't you write down your phone number for me."
It sounds like you're asking them to give you their number, but you're actually TELLING them to give it to you.
It's so subtle it's almost never detected.