Skip to content

Commit 93dabef

Browse files
author
mmccurrey
committed
Previous fix to support data-format types broke SQLServer tests. Corrected with a patch to apply the data-format only when its of type String
1 parent 5ea0079 commit 93dabef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/IBatisNet.DataMapper/Commands/DataReaderDecorator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ DateTime IDataRecord.GetDateTime(int i)
252252
{
253253
string dateTimeFormat = ConfigurationManager.AppSettings["dateTimeFormat"];
254254

255-
if (!string.IsNullOrWhiteSpace(dateTimeFormat))
255+
if ((!string.IsNullOrWhiteSpace(dateTimeFormat)) && (_innerDataReader.GetFieldType(i)==typeof(string)))
256256
{
257257
return DateTime.ParseExact(_innerDataReader.GetString(i), dateTimeFormat, CultureInfo.InvariantCulture);
258258
}

0 commit comments

Comments
 (0)