I wouldn't do it based on query string params. I recommend using mutliple sites with site for each language and force each site to a specific cutlture as described in the document, then the flags can just link to the sites. Changing the culture is only going to affect buttons and labels not content coming from the database.
It is however possible to set the culture from code
string cultureName = "it-IT";
CultureInfo siteCulture = new CultureInfo(cultureName);
Thread.CurrentThread.CurrentCulture = siteCulture;
Thread.CurrentThread.CurrentUICulture = siteCulture;
Might be better to use a dropdown list and set a cookie with the culture name instead of a query string param, it can throw an error if an invalid language code is used.
Hope it helps,