When I was single I fended guys/gals off with complete honesty. Let's say someone asked me to dance I'd tell them I'd love to dance BUT I'm not interested in talking or you buying me a drink. I just want to listen to the band, dance and enjoy my own company. or something along those lines.
If someone asked to buy me a drink I'd tell them I appreciate the offer but this is a ME night.
I was always polite (with a few rare exceptions for especially persistent guys/gals) but made it well known that I was there for the music and dancing not hooking up.
But being completely honest in a bar tends to make people look at you like you are a nutjob but they go away so it works