2 Replies - 1514 Views - Last Post: 18 March 2015 - 10:46 AM Rate Topic: -----

#1 mb2000inc  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 22
  • View blog
  • Posts: 354
  • Joined: 10-November 09

C# not returning values? But, WHY NOT?

Posted 26 June 2013 - 10:18 AM

I ran across this code while trying to debug a problem with an application that wasn't returning any values...
This belonged to my predecessor.

I was asked:

Quote

Well, why doesn't it return any records??


To which I simply replied:

Quote

because my predecessor is a nimrod


///<summary>
///Gets all the related events that the user has processed from the system.
///</summary>
///<param name="currentEvent"></param>
///<returns></returns>
private EventHeaderRow[] GetRelatedEvents(EventHeaderRow current Event)
{
    return null;
}



Is This A Good Question/Topic? 0
  • +

Replies To: C# not returning values? But, WHY NOT?

#2 stewie-Y  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 21-February 11

Re: C# not returning values? But, WHY NOT?

Posted 08 March 2015 - 08:04 PM

Did he who asked you that even attempt to look? haha
Was This Post Helpful? 0
  • +
  • -

#3 Curtis Rutland  Icon User is offline

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4641
  • View blog
  • Posts: 8,192
  • Joined: 08-June 10

Re: C# not returning values? But, WHY NOT?

Posted 18 March 2015 - 10:46 AM

Ha, I just found a bug in some code I wrote recently that was similar. I had a method that would compare records, and only return true if certain fields matched. During testing I added a return true; to the top of the method, just for debugging purposes. Same with a SQL SP, it had a TOP 100 line. I managed to find both issues before it made it to PROD, but it just goes to show, it's easy to forget debug code.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1