How to create a SQL database from Linq2Sql model

Is it possible to create a SQL database from the Linq2Sql model? I managed to lose the database for what I started building a year ago, but I have a Linq2Sql model. If possible, what are the steps?

+6
sql linq linq-to-sql
source share
3 answers

You are looking for something like this

A practical guide. Dynamic Database Creation (LINQ to SQL)

YourDataContext db = new YourDataContext ("C:\\YourDB.mdf"); db.CreateDatabase(); 
+6
source share

I have not used this, but I believe huagati can do this.

http://www.huagati.com/dbmltools/

+1
source share

see links below:

http://www.perpetuumsoft.com/Product.aspx?lang=en&pid=55&tid=linqtosqlsynchronization

http://www.codeproject.com/KB/linq/LINQ_to_SQL_Database_Sync.aspx

http://msdn.microsoft.com/en-us/library/bb399420.aspx

from MSDN:

 public class MyDVDs : DataContext { public Table<DVD> DVDs; public MyDVDs(string connection) : base(connection) { } } [Table(Name = "DVDTable")] public class DVD { [Column(IsPrimaryKey = true)] public string Title; [Column] public string Rating; } 
0
source share

All Articles