Reputation: 12716
I'm using Code-first and entity framework in my .NET MVC 3 application, I created simple entity and can save new one and retreive list of them from entity framework. The problem is that I can not find the db where this data is stored.
I created another application, copied my entity class there and it uses the same storage as the first one, I see the list of entities which were added in the first app.
There is only one connection string in web.config (for default membership provider).
Where is the entity framework data? how can I use my database for it?
Thanks
Upvotes: 1
Views: 178
Reputation: 12716
Ok, I found where the DB is, in my case it is in c:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\
in order to use my database I use this connection string:
<connectionStrings>
<add name="MyEntities"
connectionString="data source=.;
Initial Catalog=DbName;
Persist Security Info=True;
User ID=user;
Password=password"
providerName="System.Data.SqlClient"
/>
</connectionStrings>
I'ts a pity it can not use the same DB as membership provider, it has to be another database.
Upvotes: 1