Chiang Mai's restaurants offer a wide range of food, second only to Bangkok. Naturally it's a good place to sample northern Thai food: in particular, hunt down some khao soi, yellow wheat noodles in curry broth traditionally with chicken or beef, but available some places as vegetarian or with seafood. For those tired of eating rice or noodles there's also a wide range of excellent western food restaurant in Chiang Mai, from cheap hamburger stands to elaborate Italian eateries.
Dress Code: You are in a tropical country so daytime wear of shorts, T-shirt, etc. is quite OK; however you'll earn bonus points if you look clean and tidy. Thai people (even the poorest) take pride in personal cleanliness and appearance (look at school kids and college students) so the "unkempt" style of some visitors is not appreciated. In the evenings long trousers (dress or skirt for ladies) with a neat shirt/blouse, shoes with socks for men and nice shoes for women (no flip-flops) are a must if you wish to enter a nice restaurant and get a good seat. The nicer you dress the better the table and service. If not you might get a table next to the bathroom, in a corner away from the view or in front of a loud music speaker.
Chanchao's Chiang Mai Food Review  is a good source of information on the fast-changing culinary scene, though it has not been updated for some time.