开发者

I have lost SQL Server 2008 database, I need to the database structure back from LINQ schema

开发者 https://www.devze.com 2023-01-30 04:31 出处:网络
My SQL Server 2008 server database for one of my new projects has deleted accidentally. What I\'m left with is LINQ to SQL sche开发者_如何转开发ma file (DataContext schema and classes) and with hope t

My SQL Server 2008 server database for one of my new projects has deleted accidentally. What I'm left with is LINQ to SQL sche开发者_如何转开发ma file (DataContext schema and classes) and with hope to get my database structure back from this.

Is there a way?


For simple schema you can just call dataContext.CreateDatabase() - however it would be ambitious to hope for this to handle everything. I suspect you may have to accept the loss and (sadly) learn about the value of backups.

See MSDN for more on CreateDatabase:

http://msdn.microsoft.com/en-us/library/system.data.linq.datacontext.createdatabase.aspx


DataContext.CreateDatabase

Watch out for missing indexes, lookup data, etc.

0

精彩评论

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