Pat,
This error is related to date parsing. You are trying to parse string, which
has invalid format regarding to current locale setting. There are several
ways to resolve this problem.
- Assign appropriate locale to current thread
System.Threading.Thread.CurrentThread.CurrentCultu re =
new System.Globalization.CultureInfo("en-GB");
You can do it in application config as well.
- Parse date using DateTime.ParseExact method
DateTime datDate = DateTime.ParseExact(strDate, “DD/MM/YYYY”, null);
Hope this helps
--
Milosz Skalecki
MCP, MCAD
"Pat" wrote:
i'm passing a string as a Date as value :- for example "23/07/1988"
But when trying to insert it in a column with datatype "smalldatetime" i get
an error
The string was not recognized as a valid DateTime. There is a unknown word
starting at index 0.
any ideas