开发者

DataContext to DB

I have designed my DB using the ORM in VS 2008.

What is 开发者_如何学Cthe best way to export this to an SQL server so it will create the tables and relations on SQL Server?

Thanks,

JD


If you are using the LINQ-to-SQL, then:

var(dc = new MyDataContext()) {
    dc.CreateDatabase();
}

should do it, but only if you have all the required data. To be honest, it works better starting from tables (perhaps in SSMS) and dragging them into LINQ-to-SQL.

Also; there are a lot of important database concepts (indexing, etc) that is not expressed in DBML.


See: Export DBML to SQL script

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜