Matthew 7:21-23

'"Not everyone who says to me, 'Lord, Lord,' will enter the kingdom of heaven, but only he who does the will of my Father who is in heaven. Many will say to me on that day, 'Lord, Lord, did we not prophesy in your name, and in your name drive out demons and perform many miracles?' Then I will tell them plainly, 'I never knew you. Away from me, you evil-doers!'

Note that this isn't a contradiction of salvation by grace - genuine salvation always leads to a change in lifestyle, and good deeds, but the good deeds are the result and sign of salvation, not the cause of it.

Also, be careful that these verses don't cause you to doubt your own salvation without reason - let them instead lead you to walk closely with God, and to 'work out your salvation with fear and trembling'.