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

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
NSY738
Posts: 6
Joined: Fri 24 Feb 2017 06:08

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

Post by 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.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

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

Post by 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.

NSY738
Posts: 6
Joined: Fri 24 Feb 2017 06:08

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

Post by 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

Post Reply