Basically agree with advice already given, its important to be non-needy and fun (laughter, get her smiling). What girl would deny the opportunity to laugh ?
I say, if you can naturally on the fly generate laughter all the best to you but most guys (especially those just starting) need some canned lines to do the job and it isn't some sin to do that... do what you have to do
I try to open with whatever is on my mind (with practice you'll start to get better with being funny and fun) and then transition with some canned lines for generating attraction...
"Ur definitely bad news, I knew it as soon as I saw you"
"Me and you would never get along"
Of course it varies depending on situation though. Woman in a rush, u need to something dramatic and quick. Woman sitting down you can open with something subtle, etc.. Key is to KNOW where u want to take the conversation, don't leave it to chance it will naturally flow (which it might) open and then have a natural progression...
Most women I meet will NOT help you with the conversation (the ones that do are ultra cool though) so having something prepared for the first 2 awkward minutes is key, just keep talking until she joins the conversation or ur gut tells you shes completely uninterested... but do it in a casual non-needy way (haha its tough yes)
Example
I approached two girls a bar a month back, some guy was holding court but I went in with...
"Hey bro, what's her name?"
Obviously he had no clue and she in turn blows him out for me and I use that to continue conversation with the girl (the one i'm NOT interested in btw) about how its not guys fault we don't remember your names, most girls have weird names and what about the strippers who have names like "lotta money stacks" etc...
This led to a solid 6-7 minutes of laughter and funny assumptions about male and females, who flushes and who doesn't etc.. BUT in my head I was always thinking what is the NEXT STEP, don't leave it to women to do this, we as men have to lead the conversation... Then I transitioned using the corny (but effective) line directed at the woman I was interested in... "why are u so quiet... what are u hiding ? are u the quiet type... omg i knew it.... ur definitely bad!!"
This gets typical response "no im not" blah blah blah and then u can use the friend who u've already established convo with the first 5 minutes to reaffirm you as cool... basically my pick-up progressed because I knew where I was taking it... I didn't just go in with... "Hey!" and wait for the fire-works... have a plan