Ejemplo n.º 1
0
        public void GetDatatoGrid()
        {
            objHRInfo = new HRInfo();
            DataSet ds = objHRInfo.GetDuplicatRecords();

            objHRInfo = null;
            DataTable dt     = ds.Tables[0];
            int       intRow = 1;

            gvMultiple.Rows.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DataGridViewRow  tempRow  = new DataGridViewRow();
                DataGridViewCell cellSLNO = new DataGridViewTextBoxCell();
                cellSLNO.Value = intRow;
                tempRow.Cells.Add(cellSLNO);

                DataGridViewCell cellAppNo = new DataGridViewTextBoxCell();
                cellAppNo.Value = dt.Rows[i]["HAMH_APPL_NUMBER"];
                tempRow.Cells.Add(cellAppNo);

                DataGridViewCell celleCode = new DataGridViewTextBoxCell();
                celleCode.Value = dt.Rows[i]["HAMH_EORA_CODE"];
                tempRow.Cells.Add(celleCode);

                DataGridViewCell cellename = new DataGridViewTextBoxCell();
                cellename.Value = dt.Rows[i]["HAMH_NAME"];
                tempRow.Cells.Add(cellename);

                DataGridViewCell cellFname = new DataGridViewTextBoxCell();
                cellFname.Value = dt.Rows[i]["HAMH_FORH_NAME"];
                tempRow.Cells.Add(cellFname);

                DataGridViewCell cellDOB = new DataGridViewTextBoxCell();
                cellDOB.Value = Convert.ToDateTime(dt.Rows[i]["HAMH_DOB"]).ToString("dd/MMM/yyyy");;
                tempRow.Cells.Add(cellDOB);

                DataGridViewCell cellDOJ = new DataGridViewTextBoxCell();
                cellDOJ.Value = Convert.ToDateTime(dt.Rows[i]["HAMH_DOJ"]).ToString("dd/MMM/yyyy");
                tempRow.Cells.Add(cellDOJ);

                DataGridViewCell cellStatus = new DataGridViewTextBoxCell();
                cellStatus.Value = dt.Rows[i]["STATUS"];
                tempRow.Cells.Add(cellStatus);

                intRow = intRow + 1;
                gvMultiple.Rows.Add(tempRow);
            }
        }