private void LoadAdjustLeave() { SqlCommand cmd = new SqlCommand(); SqlDataAdapter da; cmd.Connection = con; cmd.CommandType = CommandType.Text; try { //string sql = " select USER_ID as UserID, LateDays,Leave,Remainingminutes,Month,Year from Accounts_LateEntry_Salary_Deduct where User_ID='" + gvStaffDetails.SelectedRow.Cells[2].Text.ToString().Trim() + "'"; string sql = "select convert(VARCHAR(12),LeaveDate) as leavedate, InformType, TotalDays, Leave,Applyhrs from deletetable where UserID='" + gvStaffDetails.SelectedRow.Cells[2].Text.ToString().Trim() + "' and Month='" + Session["paymonth"] + "' and Year='" + Session["payyear"] + "'"; da = new SqlDataAdapter(sql, con); //DataSet ds = new DataSet(); DataTable dt = new DataTable(); da.Fill(dt); con.Open(); gvadjustleave.DataSource = dt; Session["AdjustLeave"] = dt; gvadjustleave.DataBind(); con.Close(); } catch (Exception Ex1) { LblErr.Text = Ex1.Message.ToString(); return; } }
ddlType.Item.Clear(); ddlType.DataSource = dt; ddlType.DataBind();
select distinct InformType from deletetable
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)