Answered by:
Using SqlServer Compact Toolbox

Question
-
Hi, there.
I am starting to use VS2013 with SqlCe databases and the SqlServer Compact Toolbox.
I have 2 SqlCe databases which I have updated from version 3.5 to 4.0. In the toolbox, I can view/edit top 200 rows of both. So, the data seems OK for both. But I can only add Entity Data Model (EDMX) for one of them. For the failing database, I see Row count for all tables -1, whereas for the other I get correct row count. Something seems to be different and wrong with that database, but what? The data is all there.Any comments will be appreciated.
Gudni SigurdssonWednesday, June 4, 2014 2:26 PM
Answers
-
To use a database with Entity Framework, all tables must have a primary key, I think that may be the issue.
But what does "failing" actually mean?
Please mark as answer, if this was it. Visit my SQL Server Compact blog http://erikej.blogspot.com
- Marked as answer by Gudni Sigurdsson Thursday, June 5, 2014 9:01 AM
Wednesday, June 4, 2014 5:17 PM -
Thanks, Gudni, let me know if you miss anything in the Toolbox or encounter any issues.
Please mark as answer, if this was it. Visit my SQL Server Compact blog http://erikej.blogspot.com
- Marked as answer by Gudni Sigurdsson Thursday, June 5, 2014 9:21 AM
Thursday, June 5, 2014 9:17 AM
All replies
-
To use a database with Entity Framework, all tables must have a primary key, I think that may be the issue.
But what does "failing" actually mean?
Please mark as answer, if this was it. Visit my SQL Server Compact blog http://erikej.blogspot.com
- Marked as answer by Gudni Sigurdsson Thursday, June 5, 2014 9:01 AM
Wednesday, June 4, 2014 5:17 PM -
Hi, Erik.
You were right, of course. One of my databases had a primary key defined, whereas the other did not. After having defined a primary key for the "failing" database, I could add an EDMX for that one as well. "Failing" means here only not being able to create an EDMX.
I have used SqlCe databases quite a bit in the past, both for desktop computers and on handheld devices for data acquisition in the field. When I decided to move from VS2008 and VS2010 to VS2013, I found that SqlCe was not supported. Then, your SQL Server Compact Toolbox came to the rescue.
Thanks a lot, Eric.
GudniThursday, June 5, 2014 9:15 AM -
Thanks, Gudni, let me know if you miss anything in the Toolbox or encounter any issues.
Please mark as answer, if this was it. Visit my SQL Server Compact blog http://erikej.blogspot.com
- Marked as answer by Gudni Sigurdsson Thursday, June 5, 2014 9:21 AM
Thursday, June 5, 2014 9:17 AM