Question

Gudni Sigurdsson on Wed, 04 Jun 2014 14:26:08


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 Sigurdsson


Sponsored



Replies

ErikEJ on Wed, 04 Jun 2014 17:17:41


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?

Gudni Sigurdsson on Thu, 05 Jun 2014 09:15:44


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

ErikEJ on Thu, 05 Jun 2014 09:17:55


Thanks, Gudni, let me know if you miss anything in the Toolbox or encounter any issues.