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 fi开发者_Go百科rst 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
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.
精彩评论