private string GetSql()
{
bool a = true;
bool b = true;
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.AppendFormat("SELECT * FROM mytable WHERE 1 = 1");
if (a)
sb.AppendFormat(" AND `aa` = 1");
if (b)
sb.AppendFormat(" AND `bb` = 1");
sb.AppendFormat(";");
return sb.ToString();
}