The same way you'd write any other SQL query in the code-behind.
using (SqlConnection connection = new SqlConnection("YOUR CONNECTION STRING"))
using (SqlCommand command = new SqlCommand("SELECT CASE WHEN @Flag = 1 THEN 'Yes' ELSE 'No' END FROM YourTable", connection))
{
command.Parameters.AddWithValue("@Flag", true);
...
}
If you want a more detailed answer, then you're going to have to provide a more detailed question.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer