Time field in firebird is wrongfully mapped by designer as a DateTime

Posts   
 
    
Posts: 256
Joined: 05-Jul-2010
# Posted on: 16-Jul-2010 11:35:41   

Hi

I have a Time Field in a Firebird 2.5 database. The designer proposes this field as System.DateTime. This should be a System.Timespan.

If I convert it to the right field it asks me for a TypeConverter.
I don't mind writing one, but I think it is just mapped to the wrong type by default.

Alexander

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 16-Jul-2010 12:01:29   

According to the ADO.NET provider, 'time' is a DateTime: con.GetSchema("DataTypes");

gives the list of types and the .NET types. There's no other documentation so I have no idea where you did get the info it should be a Timespan? (it would be logical to do, but there's no list of firebird types <-> .NET types anywhere as there's 0.0 documentation shipped with the provider.

(tested with 2.1 and 2.5.2 provider)

Frans Bouma | Lead developer LLBLGen Pro
Posts: 256
Joined: 05-Jul-2010
# Posted on: 16-Jul-2010 12:08:25   

Otis wrote:

According to the ADO.NET provider, 'time' is a DateTime: con.GetSchema("DataTypes");

gives the list of types and the .NET types. There's no other documentation so I have no idea where you did get the info it should be a Timespan? (it would be logical to do, but there's no list of firebird types <-> .NET types anywhere as there's 0.0 documentation shipped with the provider.

As for the documentation, I sponsor Jiri's work a lot because I know that all his work is on almost volountary basis. If I'm not mistaken it is a grant of less than 50€ per month. I'm pretty sure Jiri wouldn't mind documenting it, if somebody would make "time" for it.

That aside, reading the time fields as datetime doesn't work (llblGenPro can't load it) and I know the entity framework loads it (without issues) as a Timespan. These two reasons are the ones why I thought it should be a Timespan.

If I would write a converter, do you have any idea between what types I need to convert? Timespan and ???.

Many thanks

Alexander

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 16-Jul-2010 12:12:59   

The only things that an ADO.NET provider needs in its documentation are: - the GetSchema specifics - the .NET types returned for each db type supported.

It is otherwise a big trial/error gamble and as you can see, the ado.net provider reports things wrongly sometimes (or incomplete).

Anyway, it's very easy to correct this for us, it's an entry in a table in the firebird driver. I'll change it to timestamp.

(edit) changed in next build.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 256
Joined: 05-Jul-2010
# Posted on: 16-Jul-2010 13:08:24   

Look at the bright side of all my questions.

It will work even better for firebird than it already does!smile

Posts: 256
Joined: 05-Jul-2010
# Posted on: 16-Jul-2010 20:41:51   

Alexander wrote:

Look at the bright side of all my questions.

It will work even better for firebird than it already does!smile

Also SOLVED.

Now it proposes the fields as timespan and they work.

Thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 16-Jul-2010 22:00:48   

Alexander wrote:

Alexander wrote:

Look at the bright side of all my questions.

It will work even better for firebird than it already does!smile

Also SOLVED.

Now it proposes the fields as timespan and they work.

Thanks

great! simple_smile I talked to Jiri via twitter, and told him about the little glitch in the GetSchema thingy, he said he'd look into it.

Frans Bouma | Lead developer LLBLGen Pro