DBFIt to handle new datatype in SQL Server 2016?

33 views
Skip to first unread message

Erin Kozak

unread,
Feb 17, 2021, 1:21:10 PM2/17/21
to dbfit
We are having trouble getting the 'time' datatype from SQL Server 2016 to work in a dbfit test.  Here is the error:

System.InvalidCastException: Failed to convert parameter value from a DateTime to a TimeSpan. ---> System.InvalidCastException: Invalid cast from 'System.DateTime' to 'System.TimeSpan'. at System.Convert.DefaultToType(IConvertible value, Type targetType, IFormatProvider provider) at System.Data.SqlClient.SqlParameter.CoerceValue(Object value, MetaType destinationType, Boolean& coercedToDataFeed, Boolean& typeChanged, Boolean allowStreaming) --- End of inner exception stack trace --- at System.Data.SqlClient.SqlParameter.CoerceValue(Object value, MetaType destinationType, Boolean& coercedToDataFeed, Boolean& typeChanged, Boolean allowStreaming) at System.Data.SqlClient.SqlParameter.GetCoercedValue() at System.Data.SqlClient.SqlParameter.Validate(Int32 index, Boolean isCommandProc) at System.Data.SqlClient.SqlCommand.SetUpRPCParameters(_SqlRPC rpc, Int32 startCount, Boolean inSchema, SqlParameterCollection parameters)

Yavor Nikolov

unread,
Feb 17, 2021, 3:00:14 PM2/17/21
to dbfit
Hi,
This is related to the .NET implementation of DbFit which is maintained in a separate project (fitsharp). So you may contact fitsharp community or consider trying the Java implementation.

On Wed, Feb 17, 2021, 20:21 Erin Kozak <erin...@gmail.com> wrote:
We are having trouble getting the 'time' datatype from SQL Server 2016 to work in a dbfit test.  Here is the error:

System.InvalidCastException: Failed to convert parameter value from a DateTime to a TimeSpan. ---> System.InvalidCastException: Invalid cast from 'System.DateTime' to 'System.TimeSpan'. at System.Convert.DefaultToType(IConvertible value, Type targetType, IFormatProvider provider) at System.Data.SqlClient.SqlParameter.CoerceValue(Object value, MetaType destinationType, Boolean& coercedToDataFeed, Boolean& typeChanged, Boolean allowStreaming) --- End of inner exception stack trace --- at System.Data.SqlClient.SqlParameter.CoerceValue(Object value, MetaType destinationType, Boolean& coercedToDataFeed, Boolean& typeChanged, Boolean allowStreaming) at System.Data.SqlClient.SqlParameter.GetCoercedValue() at System.Data.SqlClient.SqlParameter.Validate(Int32 index, Boolean isCommandProc) at System.Data.SqlClient.SqlCommand.SetUpRPCParameters(_SqlRPC rpc, Int32 startCount, Boolean inSchema, SqlParameterCollection parameters)

--
You received this message because you are subscribed to the Google Groups "dbfit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dbfit+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dbfit/3869352d-e46d-4949-afa5-b4ff5b69f163n%40googlegroups.com.

Erin Kozak

unread,
Feb 17, 2021, 3:14:14 PM2/17/21
to dbfit
where do i get the Java version?

Yavor Nikolov

unread,
Feb 17, 2021, 3:33:21 PM2/17/21
to dbfit

Erin Kozak

unread,
Feb 17, 2021, 3:40:01 PM2/17/21
to dbfit
thats what we already use...

Yavor Nikolov

unread,
Feb 20, 2021, 5:11:08 AM2/20/21
to dbfit
Check the docs:

Do not configure specific TEST_RUNNER related to FitSharp's runner.

If you are still having troubles, please share more details about your test pages setup.

Reply all
Reply to author
Forward
0 new messages