I have a VB6 function that has an optional date interval parameter that I'm trying to convert to C#. I'm also not sure of the best way to handle this in code. Here is the VB function declaration:
Private Function ReplaceDateTextNonBinary(psTable as String, psColumn as String, psColumnOffSet as String, psDateFormat as String, Optional psInterval as String = "n")
This function uses the optional parameter in the following DateAdd method call.
DateTime = DateAdd(psInterval, oSQL.Value(psColumnOffset), Date$)
Here is how I was planning to convert the function declaration to C# using the params keyword.
private static bool ReplaceDateTextNonBinary(string psTable, string psColumn, string pColumnOffset, string psDateFormat, params string psInterval)
I think this would work but I'm don't know how to code this that would take any date interval as a string. I was thinking of using a switch...case statement but that didn't seem very elegant.
Any thoughts.