Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
public List<holidayreg> FillHolidayData(RequestResponse request)
{
   List<holidayreg> ListHoliday = new List<holidayreg>();
   DataSet ds = null;
   try
   {
      if (ds == null)
      {
         ds = new DataSet();
         SqlParameter[] inputPara = new SqlParameter[2];
         inputPara[0] = new SqlParameter(BALResource.PayrollResources.HolidayID, request.HollidayReg.HolidayID);
         inputPara[1] = new SqlParameter(BALResource.PayrollResources.Mode, request.HollidayReg.Mode);
         ds = LoadGridData(BALResource.PayrollResources.ProcedueHolidaySelectDelete, inputPara);
         DataTable dt = ds.Tables[0];
         HolidayReg objHoliday = new HolidayReg();
         for (int row = 0; row < dt.Rows.Count; row++)
         {
            objHoliday = new HolidayReg();
            foreach (DataColumn dc in dt.Columns)
            {
               foreach (PropertyInfo prop in objHoliday.GetType().GetProperties())
               {
                  if (prop.Name == dc.ColumnName && prop.CanWrite)
                  {
                     if (dt.Rows[row][dc.ColumnName] != DBNull.Value)
                     {
                        prop.SetValue(objHoliday, dt.Rows[row][dc.ColumnName], null);
                     }
                  }
               }
            }
            ListHoliday.Add(objHoliday);
         }
      }
   }
   catch (Exception ex)
   {
      throw ex;
   }
   return ListHoliday;
}
Posted 2-Jan-13 22:05pm
Edited 3-Jan-13 11:44am
v3

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Put a breakpoint at:
ds = LoadGridData(BALResource.PayrollResources.ProcedueHolidaySelectDelete, inputPara);
then jump to:
DataTable dt = ds.Tables[0];
I am sure your function is not returning any data. Check it.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 580
1 OriginalGriff 420
2 Sascha Lefévre 289
3 CHill60 225
4 Abhinav S 220
0 Sergey Alexandrovich Kryukov 9,773
1 OriginalGriff 9,290
2 Peter Leow 5,137
3 Kornfeld Eliyahu Peter 3,373
4 Maciej Los 3,036


Advertise | Privacy | Mobile
Web04 | 2.8.150327.1 | Last Updated 3 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100