Hi,
I am reading values from text file and my database column type is date. not datetime
value in my text file
data[2] = 20150903 12:39:12
Exception
Exception calling "ParseExact" with "3" argument(s): "String was not recognized as a valid DateTime." At D:\BatchandQueries\PowerShell\Walmart\Test.PS1:128 char:45 + $shoppingDate = [datetime]::ParseExact <<<< ($data[2],'MM/dd/yyyy HH:mm:ss',$null) + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : DotNetMethodException
Code:
[DateTime]$BirthDate = Get-Date -Date "1970-01-01 00:00:00Z" $BirthDate = [datetime]::ParseExact($data[2],'MM/dd/yyyy HH:mm:ss',$null)
How to send this string value as date to my sqlserver database column whihc has the type of date. please help me