I am pulling a starting date out of a table in the database. The field is a text field in an Access DB. I created a function to validate the date.
This works and returns to me true or false. I am trying to figure out where the best place to use this code, in the function(FindStartDate) that returns the date? Or after the function is called like the following?Code:public bool IsDate(String testDate) { DateTime dtTest; return DateTime.TryParse(testDate, out dtTest); }
I think either way will work but which way is a better design?Code:String DateRangeStart = FindStartDate(strComp); if (util.IsDate(DateRangeStart) == false) { .... }
Thanks.




Reply With Quote