私はpsqlデータベースからデータを取り出し、BizTalkを使用してSQL Serverデータベースに挿入しようとしています。 6/30/2016 12:00:00 AM
SQL ServerのDateTimeoffsetに文字列を変換します
私はタイプdatetimeoffset
のDateCreated
と呼ばれるSQL Serverの列にそのデータを挿入したいのような時間帯でタイプTimeStamp
のcreateddate
と呼ばPSQLの列があります。 ParseExactについては
String was not recognized as a valid DateTime.
Exception type: FormatException
Source: mscorlib
Target Site: System.DateTime ParseExact(System.String, System.String, System.Globalization.DateTimeFormatInfo, System.Globalization.DateTimeStyles)The following is a stack trace that identifies the location where the exception occurred
at System.DateTimeParse.ParseExact(String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style)
at System.Xml.Xsl.CompiledQuery.Script1.ConvertDateCreated(String dateCreated)
at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current)
at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current)
at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)
at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver)
オリジナルのデータベースから返される日付文字列の例がありますか? – PaulF
それは '6/30/2016 12:00:00 AM'と同じです – user4912134
あなたのフォーマットは' dd/MM/yyyy HH:mm:ss' – Nived