Click here to Skip to main content
12,447,625 members (58,980 online)
Rate this:
 
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 21:05pm
Updated 3-Jan-13 10: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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160811.3 | Last Updated 3 Jan 2013
Copyright © CodeProject, 1999-2016
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