So I was following this introduction to the Entity Framework Code First to create a new database ( https://msdn.microsoft.com/en-us/data/jj193542 ) and I followed the example completely. Now I want to add it to my server explorer in Visual Studio 2013.
Tried both LocalDb ((localdb)\v11.0) or SQL Express (.\SQLEXPRESS) but the database doesn't show, I know it's working because I've tested it multiple times now and it keeps appending and fetching data from the database, so where would it be residing?
Besides the default Visual Studio 2013 I have an SQL Server setup. Thanks
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit go.microsoft.com/fwlink/… -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>
Select Data from the left menu and then ADO.NET Entity Data Model Select the connection to the database you created in the first section and click Next Click the checkbox next to Tables to import all tables and click Finish
I created a new UWP App with a UWP Class library to hold an Entity Framework Core Data Access layer. LocalDB is not supported on this platform. Back in my original program I have discovered that create database behaviour of the UWP app is different when running in release mode to running in debug mode.
We will use the Entity Framework Tools for Visual Studio to help us generate some initial code to map to the database. These tools are just generating code that you could also type by hand if you prefer. Project -> Add New Item… Select Data from the left menu and then ADO.NET Entity Data Model
This scenario includes targeting a database that doesn’t exist and Code First will create, or an empty database that Code First will add new tables to. Code First allows you to define your model using C# or VB.Net classes.
Looking at your config (supplied during chat) I can see that your EF is using localdb and MSSQLLocalDB
instance.
Try:
(localdb)\MSSQLLocalDB
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With