private void btnExecuteAsObjectUsingSqlQuery_Click(object sender, EventArgs e) { try { lblTitle.Text = "Execute As Object Using SQL Query : GET FILM BY ID"; int film_id = 133; string query = QueryBase.GetFilmByID(film_id); Film film = null; Task.Factory.StartNew(() => { film = sqlHandler.ExecuteAsObjectUsingQuery <Film>(query); }).Wait(); ICollection <Film> lstData = new List <Film>(); lstData.Add(film); dgvResult.DataSource = lstData; } catch (Exception ex) { DisplayError(ex.Message); } }