private void BindDataToGridView() { favJobs = service.GetListOfFavJobs(new DbJob(), Guid.Parse(Session["sessionid"].ToString())); if (favJobs.Count > 0) { dt2 = ToDataTable <DbJob>(favJobs.ToList()); dt2.Columns.Remove("UserId"); dt2.Columns.Remove("JobId"); dt2.Columns.Remove("Description"); gvFavJobs.DataSource = dt2; gvFavJobs.DataBind(); } else { lblMsg.Text = "No jobs added to the favourites."; lblMsg.Visible = true; } }