问题
So I've been having problems with this tutorial for SQL on the MDSN website. The first picture says what it should like to add a new file to the project but when I try to repeat the instruction on VS the service based database file is missing. Does anybody know what I should do?
回答1:
Please try to this way:
Go to Control Panel -> Uninstall a Program, select Visual Studio 201x, right click, Change -> Modify, and check whether you have installed "Microsoft SQL Server Data Tools", if you didn't install it, please check it and follow the steps to install it.
If you have installed it, to make sure whether it is related to your corrupted templates, please take the following steps to reset your templates:
Open Windows Explorer, and navigate to \Common7\IDE (by default is C:\Program Files or Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE);
Delete the ItemTemplatesCache, ProjectTemplatesCache folder;
Open Visual Studio Command Prompt under Start menu -> All Programs -> Microsoft Visual Studio -> Visual Studio Tools (run it with administrative privilege);
Run the devenv /InstallVSTemplates switch;
Run the devenv /Setup switch;
Hope this information is helpful.
回答2:
I found out that you can't. Service Based Databases are for WinForms projects only and aren't available for Windows Universal Projects.
But you can use SQLite for UWP projects. The download is here
来源:https://stackoverflow.com/questions/36590773/service-based-database-file-missing