Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. for (int id = 0; id < 200; id++)
  2. {
  3. var foundID = from r in dv.AsEnumerable()
  4. orderby r.Field<string>("Log Date")
  5. where r.Field<int>("User ID") == id
  6. select r;
  7.  
  8. foreach (var row in foundID)
  9. {
  10.  
  11. var foundDate = overtime.Select("ID = '" + id
  12. + "' AND 'Log Date' = '"+row.Field<string>("Log Date")+"'");
  13.  
  14.  
  15.  
  16.  
  17.  
  18. if(foundDate.Count() == 0){
  19. Rowq["ID"] = row.Field<int>("User ID");
  20. Rowq["Date"] = row.Field<string>("Log Date");
  21. overtime.Rows.Add(Rowq);
  22. Rowq = overtime.NewRow();
  23.  
  24. id++;
  25. }
  26. else { continue; }
  27.  
  28.  
  29. }
  30.  
  31. 0000000002 Name1 2014/10/16 09:03:13 F1
  32. 0000000002 Name1 2014/10/16 17:02:20 F2
  33. 0000000002 Name1 2014/10/18 08:38:42 F1
  34. 0000000002 Name1 2014/10/18 16:55:02 F2
  35. 0000000002 Name1 2014/10/19 09:05:21 F1
  36. 0000000004 Name2 2014/10/01 00:07:09 F2
  37. 0000000004 Name2 2014/10/01 15:46:49 F1
  38. 0000000004 Name2 2014/10/02 00:09:52 F2
  39.  
  40. ID Name Date F1 F2
  41. 0000000002 Name1 2014/10/16 09:03:13 17:02:20
  42. 0000000002 Name1 2014/10/18 08:38:42 16:55:02
  43. etc..
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement