time(7) data type problem

Posts   
 
    
Gianc1412
User
Posts: 40
Joined: 30-Oct-2007
# Posted on: 24-May-2010 19:29:30   

Generator 2.6: APR - 13 - 2010 Runtime: v2.0.50727 asp.net 4.0 vs 2010

Using a gridview, I cannot update any fields with a 'time(7)' data type. If I update a field of the record with a datatype of 'date', 'datetime', or varchar, the update takes place. Also, I can see the UPDATE sql generated in the output window. However, if I update a 'time(7)' field in that same record, the update does not take place and I do not see any UPDATE sql generated in the output window.

No exceptions are thrown. Im using a test value of 17:32:19.

How do you use the 'time(7)' data type? Is it supported?



 <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
    DataKeyNames="Id" DataSourceID="LLBLGenProDataSource1">
     <Columns>
         <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
         <asp:BoundField DataField="Id" HeaderText="Id" ReadOnly="True" 
             SortExpression="Id" />
         <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
         <asp:BoundField DataField="Description" HeaderText="Description" 
             SortExpression="Description" />
         <asp:BoundField DataField="StartDate" HeaderText="StartDate" 
             SortExpression="StartDate" />
         <asp:BoundField DataField="StartTime" HeaderText="StartTime" 
             SortExpression="StartTime" />
         <asp:BoundField DataField="EndDate" HeaderText="EndDate" 
             SortExpression="EndDate" />
         <asp:BoundField DataField="EndTime" HeaderText="EndTime" 
             SortExpression="EndTime" />
     </Columns>
</asp:GridView> 
 <llblgenpro:LLBLGenProDataSource ID="LLBLGenProDataSource1" runat="server" 
    DataContainerType="EntityCollection" 
    EntityCollectionTypeName="RestaurantData.DAL.CollectionClasses.CalendarEventCollection, RestaurantData.DAL">
</llblgenpro:LLBLGenProDataSource>


daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 25-May-2010 03:53:38   

What DB are you using? What is the mapped .Net type of your time(7)? Did you check if there is any generated sql? You can set a breakpoint on setter of the involved field, just to see what is the value the Grid sends.

David Elizondo | LLBLGen Support Team
Gianc1412
User
Posts: 40
Joined: 30-Oct-2007
# Posted on: 26-May-2010 00:03:51   

I'm using SQL Server 2008.

The Visual Studio IDE is automatically mapping the time(7) to a TimeSpan type.

When setting break points, the Update method on the entity or it's TimeSpan properties are not being called.

No Update SQL is generated.

This is all using LLBLGEN and Visual Studio generated code through the designers.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 26-May-2010 07:14:09   

Reproduced. The thing is that the text returned by the grid, can't be translated to the destination type (TimeSpan).

I'm looking into a solution.

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 26-May-2010 09:50:13   

TimeSpan doesn't implement IConvertable and therefore can't be converted. We'll add a special case for this (as we did for Guid).

(edit) please try the attached assembly to see if this solves your problem. Be sure you run the updated dll, in webapplications it can sometimes happen vs.net keeps the old one around. To get exceptions for illegal values, please set the ThrowExceptionOnIllegalFieldInput property to true. This will bubble up the exception.

Frans Bouma | Lead developer LLBLGen Pro
Gianc1412
User
Posts: 40
Joined: 30-Oct-2007
# Posted on: 26-May-2010 17:37:17   

That took care of the problem. Thanks.

Posts: 3
Joined: 27-Nov-2012
# Posted on: 27-Nov-2012 11:11:52   

Otis wrote:

TimeSpan doesn't implement IConvertable and therefore can't be converted. We'll add a special case for this (as we did for Guid).

(edit) please try the attached assembly to see if this solves your problem. Be sure you run the updated dll, in webapplications it can sometimes happen vs.net keeps the old one around. To get exceptions for illegal values, please set the ThrowExceptionOnIllegalFieldInput property to true. This will bubble up the exception.

Hello,

I have the same issue with time7. i am using LLBLGen 2.6. could u share with me attachment mentioned above again.

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 27-Nov-2012 19:04:28   

Which version/build no. do you have for the ORMSupportClasses? (hint: check the forum guidelins)

Posts: 3
Joined: 27-Nov-2012
# Posted on: 28-Nov-2012 08:59:55   

Walaa wrote:

Which version/build no. do you have for the ORMSupportClasses? (hint: check the forum guidelins)

please find below informmation:

  1. LLBLGEn version that i used is 2.6
  2. I have ORMSupportClasses. it is version is 2.6 and runtime version is 2.0.50727 .
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 28-Nov-2012 13:31:29   
Frans Bouma | Lead developer LLBLGen Pro
Posts: 3
Joined: 27-Nov-2012
# Posted on: 29-Nov-2012 06:59:51   

Otis wrote:

That's the .net version. See: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7725

Thanks Otis,

Please find below information:

LLBLGen Pro version and buildnr : 2.6 Final Released on June 6th,2008

Yes I have ORMSupportClasses.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 29-Nov-2012 10:24:27   

Could you please download the latest build of v2.6 from the customer area?

Frans Bouma | Lead developer LLBLGen Pro