0

Am trying to create an EF5 Model First project at work.

After i created the model and clicked generate database from model, at first it wasn't creating the code behind. Looking a bit i found the Code Generation Strategy was set to none. I set it to Default (wonder why none is the default, rather than Default) and regenerated the database.

Now it did create the code, but it won't compile. the error reads - Partial Declaration must not specify different base classes. Only this error is in the generated code, in the container class.

I also notice that the SQLce file has no sintax highlighting and there is no Execute Script option on the right button menu, Wich according to the video at http://msdn.microsoft.com/en-us/data/jj205424.aspx there should be.

Does anyone know how to solve any of this issues?

UPDATE: So i installed VS2012 on a Win8 machine and this is correct in there - back to my original machine (Win7) i uninstalled and installed again and the problem remains. I guess this is a Win7 limitation of sorts - like the no win8 app development on Win7.

But unlike Win8 Apps, there should be no reason not to be able to develop DB apps on Win7, so my question should be rephrased as: Is there something i could install to be able to use the full length of DB tools aimed in VS2012 in Win7?

537mfb
  • 1,374
  • 1
  • 16
  • 32

2 Answers2

0

Well i found half an answer. By installing the SQL Server Data Tool for Viual Studio 2012 (December update) i get a set of SQL editors - which means i get SQL highlighting

It works only with SQL files only though - not SQLCE files (god knows why) and i still can't execute the SQL against a database.

Anyone has a better solution? Till someone finds one this is the best answer i have found

EDIT: Actually, now i CAN execute SQL's against the database - i did an open with and picked source code - now it always has the execute option. SQLCE though, still no change - no highlight and no execute option

537mfb
  • 1,374
  • 1
  • 16
  • 32
0

After i created the model and clicked generate database from model, at first it wasn't creating the code behind.

when u create the model, there is a box which asks if u want to place the code in a seperate file.. that is when it will create the code behind or else it will put the code and the asp in the same file..

Looking a bit i found the Code Generation Strategy was set to none

Do not change the setting, it is unrelated to this problem.. It will mess up the generated code.

Raghavan
  • 637
  • 3
  • 12
  • I didn't - it's none - that's not the issue - plus it IS generating code behind - only makes me have to execute the SQL against the database manually - other than that it just works – 537mfb Jan 15 '13 at 12:36