@@ -343,11 +343,13 @@ internal static void BindParameter(ISQLiteApi isqLite3Api, IDbStatement stmt, in
343343 {
344344 if ( storeDateTimeAsTicks )
345345 {
346- isqLite3Api . BindInt64 ( stmt , index , ( ( DateTime ) value ) . ToUniversalTime ( ) . Ticks ) ;
346+ long ticks = ( ( DateTime ) value ) . ToUniversalTime ( ) . Ticks ;
347+ isqLite3Api . BindInt64 ( stmt , index , ticks ) ;
347348 }
348349 else
349350 {
350- isqLite3Api . BindText16 ( stmt , index , ( ( DateTime ) value ) . ToUniversalTime ( ) . ToString ( "yyyy-MM-ddTHH:mm:ss.fffffffZ" ) , - 1 , NegativePointer ) ;
351+ string val = ( ( DateTime ) value ) . ToUniversalTime ( ) . ToString ( "yyyy-MM-ddTHH:mm:ss.fffffffZ" ) ;
352+ isqLite3Api . BindText16 ( stmt , index , val , - 1 , NegativePointer ) ;
351353 }
352354 }
353355 else if ( value is DateTimeOffset )
@@ -358,12 +360,13 @@ internal static void BindParameter(ISQLiteApi isqLite3Api, IDbStatement stmt, in
358360 {
359361 if ( storeDateTimeAsTicks )
360362 {
361- isqLite3Api . BindInt64 ( stmt , index , ( ( ISerializable < DateTime > ) value ) . Serialize ( ) . ToUniversalTime ( ) . Ticks ) ;
363+ long ticks = ( ( ISerializable < DateTime > ) value ) . Serialize ( ) . ToUniversalTime ( ) . Ticks ;
364+ isqLite3Api . BindInt64 ( stmt , index , ticks ) ;
362365 }
363366 else
364367 {
365- isqLite3Api . BindText16 ( stmt , index ,
366- ( ( ISerializable < DateTime > ) value ) . Serialize ( ) . ToUniversalTime ( ) . ToString ( "yyyy-MM-ddTHH:mm:ss.fffffffZ" ) , - 1 , NegativePointer ) ;
368+ string val = ( ( ISerializable < DateTime > ) value ) . Serialize ( ) . ToUniversalTime ( ) . ToString ( "yyyy-MM-ddTHH:mm:ss.fffffffZ" ) ;
369+ isqLite3Api . BindText16 ( stmt , index , val , - 1 , NegativePointer ) ;
367370 }
368371 }
369372 else if ( value . GetType ( ) . GetTypeInfo ( ) . IsEnum )
0 commit comments