Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

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?

asked 27 Sep '12, 10:16

Bryan's gravatar image

accept rate: 0%

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, 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.

permanent link

answered 27 Sep '12, 18:03

Bryan's gravatar image

accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 27 Sep '12, 10:16

question was seen: 2,612 times

last updated: 27 Sep '12, 18:03