on 2012 Sep 27 11:16 AM
Using Entity Framework and VS2010 to access Sybase SQL 12 database. I have a DATE (qdate) and a TIME (qtime) column in the table. Both fields are part of the table's primary key. When I attempt to retrieve any record from the table, I get the error message "The type of the key field 'qtime' is expected to be System.DateTime, but the value provided is actually of type System.TimeSpan. Has anyone else run into this and if so, how did you remedy the situation?
Here's what I eventually did to get around this. 1) since the complaint seemed to deal with using a TIME field in the Primary Key, 2) I added an autoincrement SEQNO field (bigint) and made that the Primary Key (probably a better design) and that seems to get around the issue. Fortunately I had the latitude to be able to do that, but...in the future I'll avoid using TIME columns in keys or indexes unless absolutely necessary. PB doesn't seem to have an issue with it, but Entity-Framework appears to choke on it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
71 | |
11 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.