In base-free specific N-alkylation of hydroxyl N-heterocycles with organohalides producing pyridone-type products, N,N-dimethylformamide (DMF) was found to be the best solvent for having the most prominent solvent effect among the usual solvents. This not only led to milder reaction conditions and higher yields of the products, but also could broaden the substrate scope of the reaction. Mechanistic studies and the literature revealed that, in addition to the usual solvent effect, DMF can decompose to produce dimethylamine during the reaction, which then works as a base to promote the reaction.