You must set this property to a non-null value of type 'System.Byte[]'.

You must set this property to a non-null value of type 'System.Byte[]'.

Postby NSY738 » Fri 24 Feb 2017 06:16

HI

I not sure what is the problem to cause the below error.
Hope someone here can help me on this.

Server Error in '/' Application.

The 'RowVersion' property on 'ScheduleTime' could not be set to a 'System.DateTime' value. You must set this property to a non-null value of type 'System.Byte[]'.



this problem normally occur when i using LINQ with OrderBy

Code: Select all
   List<ScheduleTime> ListScheduleTime = db.ScheduleTimes.Where(u => u.ScheduleId == Id
                                                                    && u.BeginDay == cd.Id).
                                                                    OrderBy(u => u.Id).ToList();


Is it not allow to use order by when select?

Thank You For HELP.
NSY738
 
Posts: 3
Joined: Fri 24 Feb 2017 06:08

Re: You must set this property to a non-null value of type 'System.Byte[]'.

Postby Shalex » Mon 27 Feb 2017 13:56

Please try setting the Timestamp attribute OR the .IsTimestamp() method of Code-First fluent mapping for the ScheduleTime property. If this doesn't help, send us a small test project with the corresponding DDL/DML script for reproducing the error.
Shalex
Devart Team
 
Posts: 7705
Joined: Thu 14 Aug 2008 12:44

Re: You must set this property to a non-null value of type 'System.Byte[]'.

Postby NSY738 » Thu 23 Mar 2017 05:59

HI

Thank you. the problem is because i use BigInt as key. after i change to integer then problem solved
NSY738
 
Posts: 3
Joined: Fri 24 Feb 2017 06:08


Return to dotConnect for MySQL