DateSeparator Property
Syntax:
public char DateSeparator { get; set; }
Description:
Type: System.Char
Gets or sets the current date separator information in the connection string. The date separator (along with the date format) controls how the SQL engine will convert dates to strings, indicating what character is to be used between the year, month, and day sections of the date. This has no effect on dates retrieved as DateTime objects or as dates converted to strings by the ADO .NET Data Provider itself.
Valid values are '/' (forward slash) and '-' (dash). The default, if none is specified, is '-'.
Exceptions:
Exception | Condition |
---|---|
ArgumentException | The supplied value is not a valid date separator. |