Auto Create Database Tables from Objects, Entity Framework

前端 未结 5 1270
陌清茗
陌清茗 2020-12-16 00:35

I am trying to do this tutorial http://www.asp.net/mvc/tutorials/getting-started-with-aspnet-mvc3/getting-started-with-mvc3-part4-cs but instead of using the compact edition

5条回答
  •  失恋的感觉
    2020-12-16 00:49

    If you create a Linq-to-Sql DataContext you can inject the structure directly into your Database whith:

    DbDataContext db = new DbDataContext(connectionString);
    db.CreateDatabase();
    

提交回复
热议问题