private static DataTable GetData(string sql) { Class.clsDB DB = new Class.clsDB(); DataTable dt; dt = DB.ExecuteDataTable(sql); DB.Close(); DB.Dispose(); return(dt); }
private static DataTable BindGridView() { Class.clsDB DB = new Class.clsDB(); string sql = "select job_id,job_name,create_by,create_date,print_barcode,timestamp1,timestamp2,timestamp3,timestamp4"; sql += " From job_trailer WHERE show_=1 order by job_id desc"; DataTable dt; dt = DB.ExecuteDataTable(sql); DB.Close(); DB.Dispose(); return(dt); }
private void BindGrid() { Class.clsDB DB = new Class.clsDB(); string sql = "select job_id,job_name,place_type,create_by,date_format(job_date,'%d/%m/%Y') as job_date,"; sql += " date_format(create_date,'%d/%m/%Y') as create_date,print_barcode,date_format(timestamp1,'%H:%m:%s') as timestamp1,"; sql += "date_format(timestamp2,'%H:%m:%s') as timestamp2,"; sql += "date_format(timestamp3,'%H:%m:%s') as timestamp3,date_format(timestamp4,'%H:%m:%s') as timestamp4 From job_trailer where show_=1 order by job_id desc"; DataTable dt; dt = DB.ExecuteDataTable(sql); DB.Close(); DB.Dispose(); Session["DATATABLE"] = dt; grid.DataSource = dt; // grid.DataKeyNames = "doc_id"; grid.DataBind(); }
private void BindGrid() { string today = DateTime.Now.Date.ToString("yyyy-MM-dd"); Class.clsDB DB = new Class.clsDB(); string sql = "select job_id,job_name,date_format(job_date,'%d/%m/%Y') as job_date,date_format(create_date,'%d/%m/%Y') as create_date,"; sql += "create_by,print_barcode,date_format(timestamp1,'%H:%i:%s') as timestamp1,date_format(timestamp2,'%H:%i:%s') as timestamp2,"; sql += "date_format(timestamp3,'%H:%i:%s') as timestamp3,date_format(timestamp4,'%H:%i:%s') as timestamp4 From job_trailer"; sql += " WHERE place_type='C' AND show_=1 AND job_date ='" + today + "' ORDER by job_id desc"; DataTable dt; dt = DB.ExecuteDataTable(sql); grid.DataSource = dt; grid.DataBind(); DB.Close(); DB.Dispose(); }