public partial class jobListing : System.Web.UI.Page
{
DateTime now = DateTime.Now;
SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ToString());
protected void Page_Load(object sender, EventArgs e)
{
//string applicantID = Session["ap_id"].ToString();
//lblMsg.Text = "Date today:" +now ;
loadJobList();
}
// Display record from tbl_company
protected void loadJobList()
{
con.Open();
SqlCommand cmd = new SqlCommand("SELECT j.j_id, j.j_position, j.j_location, j.j_category, j.j_datepublished, j.j_dateend, j.j_requirement, j.j_keyobjective, j.j_responsibilities, c.c_name, f.f_description FROM tbl_jobdescription j , tbl_company c , tbl_functionalarea f WHERE j.c_id = c.c_id AND j.f_id = f.f_id", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
int count = ds.Tables[0].Rows.Count;
con.Close();
if (ds.Tables[0].Rows.Count > 0)
{
GridViewJL.DataSource = ds;
GridViewJL.DataBind();
}
else
{
ds.Tables[0].Rows.Add(ds.Tables[0].NewRow());
GridViewJL.DataSource = ds;
GridViewJL.DataBind();
int columncount = GridViewJL.Rows[0].Cells.Count;
lblmsg.Text = " No data found !!!";
}
}
yes, correct but sorry actually I dont want to delete the record, just make the record invisible.
So if datepublished greater than or equal to today’s date so the record will display
And if end Date is less than today’s date so the record will not display.
I think I need to add at this code :
SqlCommand cmd = new SqlCommand("SELECT j.j_id, j.j_position, j.j_location, j.j_category, j.j_datepublished, j.j_dateend, j.j_requirement, j.j_keyobjective, j.j_responsibilities, c.c_name, f.f_description FROM tbl_jobdescription j , tbl_company c , tbl_functionalarea f WHERE j.c_id = c.c_id AND j.f_id = f.f_id", con);
Kindly help me..Thanks