1
Vote

Time fields error

description

I am using fluent to sql in a situation where I have to use a database which contains a separate table for each customer, named with the customers ID. There is also a Dummytable with the same structure, which is always empty. I therefore use fluentLinqToSql to map the fields of the table I want to interrogate to the DummyTable, and set the TableName parameter as required from a string derived at run time. So far so good. This all works splendidly, except when I have a field of type Time (MS SQLExpress) which should map (and does with normal Linq To Sql) to a Timespan? type. However, with the fluent derived dataContext, when i try to evaluate the query I get an exception that you cannot cast to a BigInt (Int64).
This unforunately is a bit of a show stopper for me, so Ihave had to work around the problem by passing an explicit SQL query to the dataContext's ExecuteQuery<>() function, but mapping the table would be much more elegant.
 
Justin

comments

JeremyS wrote Dec 14, 2009 at 5:20 PM

Hi Justin,

In order to diagnose the cause of this please could you provide me with a sample project that reproduces the issue and the appropriate sql scripts for generating the tables.

Thanks

Jeremy

wrote Feb 13, 2013 at 2:55 AM