Click here to Skip to main content
15,886,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
I began recently a new job, a very interesting project (C#,.Net 4, Linq, VS 2010 and SQL Server). And immediately I got a very exciting challenge: I must implement either a new tool or integrate the logic when program start, or whatever, but what must happen is the following: the customers have previous application and database (full with their specific data). Now a new version is ready and the customer gets the update. In the mean time we made some modification on DB (new table, columns, maybe an old column deleted, or whatever). I’m pretty new in Linq and also SQL databases and my first solution can be: I check the applications/databases version and implement all the changes step by step comparing all tables, columns, keys, constrains, etc. (all this new information I have in my dbml and the old I asked from the existing DB). And I’ll do this each time the version changed. But somehow I feel, this is NOT a smart solution so I look for a general solution of this problem.
Is there a way to update customers DB from the dbml file? To create a new one is not a problem (CreateDatabase with DataContext), is there any update/alter database methods? I guess I’m not the only one who search for such a solution (I found nothing in internet – or I looked for bad keywords). How did you solve this problem? I look also for an external tool, but first for a solution with C#, Linq or something similar.
For any idea thank you in advance!
Best regards,
Emil
Posted

MSDN[^]

rev 2:

For the update:
MSDN[^]
 
Share this answer
 
v2
Comments
Emanuil ACHIM 5-May-10 12:22pm    
Thank you for your answer, but I gues you didn't understand my problem. I'm looking for a way to update an existing DB programatically, not to create or use an existing one. The MSDN stuff I red before posting here.

Regards,
Emil
I do not have a solution for your scenario but from what I understand of DBML files, their purpose is to create classes, not databases. On the other hand they are only XML, so with two or three months work it should be possible to use them for that. :)

Seriously, though, it sounds like a dead end to me. There are loads and loads of standard methods for database schema updates. You could google for it, or, I am sure that someone with greater expertise than I will be able to help you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900