<p>I'm using LINQ to SQL classes in a project where the database design is still in a bit of flux.</p>

<p>Is there an easy way of synchronising the classes with the schema, or do I need to manually update the classes if a table design changes?</p>

[{'answer_id': 40027, 'author': 'Michael Haren', 'author_id': 29, 'author_profile': 'https://Stackoverflow.com/users/29', 'pm_score': 2, 'selected': False, 'text': '<p>I think Jeff complained about this recently. One common technique is to drag all the objects into the designer again...</p>\n\n<p>I hope someone else chimes in with a better approach!</p>\n'}, {'answer_id': 40029, 'author': 'vzczc', 'author_id': 224, 'author_profile': 'https://Stackoverflow.com/users/224', 'pm_score': 7, 'selected': True, 'text': '<p>You can use SQLMetal.exe to generate your dbml and or cs/vb file. Use a pre-build script to start it and target the directory where your datacontext project belongs.  </p>\n\n<pre><code>C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\Bin\\x64\\sqlmetal.exe \n  /server:&lt;SERVER&gt; \n  /database:&lt;database&gt; \n  /code:"path\\Solution\\DataContextProject\\dbContext.cs" \n  /language:csharp \n  /namespace:&lt;your namespace&gt;\n</code></pre>\n'}, {'answer_id': 40034, 'author': 'Espo', 'author_id': 2257, 'author_profile': 'https://Stackoverflow.com/users/2257', 'pm_score': 4, 'selected': False, 'text': '<p>I haven\'t tried it myself, but <a href="http://www.huagati.com/dbmltools/" rel="nofollow noreferrer">Huagati DBML/EDMX Tools</a> is recommended by other people.</p>\n\n<blockquote>\n  <p>Huagati DBML/EDMX Tools is an add-in\n  for Visual Studio that adds\n  functionality to the Linq2SQL/DBML\n  diagram designer in Visual Studio\n  2008, and to the ADO.NET Entity\n  Framework designer in Visual Studio\n  2008 SP1. The add-in adds new menu\n  options for updating Linq2SQL designer\n  diagrams with database changes, for\n  renaming Linq-to-SQL (DBML) and EF\n  (EDMX) classes and properties to use\n  .net naming conventions, and for\n  adding documentation/descriptions to\n  Linq-to-SQL generated classes from the\n  database properties.</p>\n</blockquote>\n\n<p><img src="https://i.stack.imgur.com/ZUC8r.png" alt="Screenshot of DBML Tools"></p>\n'}, {'answer_id': 221749, 'author': 'Rory Becker', 'author_id': 11356, 'author_profile': 'https://Stackoverflow.com/users/11356', 'pm_score': 3, 'selected': False, 'text': '<p>DamienG has written some <a href="http://damieng.com/blog/2008/07/23/linq-to-sql-t4-template-reloaded" rel="noreferrer">t4 templates</a> which can replace some of what VS generates for you. These can be rerun whenever you like via a command line tool. </p>\n\n<p>T4 templates have the added benefit of being editable. This allows you to tweak what is generated to you hearts content.</p>\n'}, {'answer_id': 326368, 'author': 'mcintyre321', 'author_id': 2086, 'author_profile': 'https://Stackoverflow.com/users/2086', 'pm_score': 1, 'selected': False, 'text': '<p>I wrote a tool to do script changes to Dbml scripts see <a href="http://code.google.com/p/linqtodbmlrunner/" rel="nofollow noreferrer">http://code.google.com/p/linqtodbmlrunner/</a> and my blog <a href="http://www.adverseconditionals.com" rel="nofollow noreferrer">http://www.adverseconditionals.com</a></p>\n'}, {'answer_id': 21531735, 'author': 'Levite', 'author_id': 1680919, 'author_profile': 'https://Stackoverflow.com/users/1680919', 'pm_score': 3, 'selected': False, 'text': "<p>Here is an easy fix without any additional software, that just works for simple changes (like added fields, few tables, etc).</p>\n\n<h3>Instructions:</h3>\n\n<ul>\n<li>You pull a copy of the changed table into the designer (will be removed later)</li>\n<li>Now select all the new (or changed) fields and (<code>right-click -&gt;</code>) <code>copy</code></li>\n<li>In your original table right click and <code>insert</code> them (delete changed fields first)</li>\n<li>Now delete the table you copied them from</li>\n</ul>\n\n<p>I know it is kinda obvious, but somehow non-intuitive, and it helped me a lot, since all the right attributes and types will be copied, and all links stay intact. Hope it helps.</p>\n\n<h3>When to use:</h3>\n\n<p>Of course it is - as said - for small changes, but surely better than manually replacing tables with many links, or when you don't want your whole database structure generated by SQLMetal. For example when you have a big amount of tables (e.g. SAP), or when using cross-linked tables from different databases.</p>\n"}, {'answer_id': 44769612, 'author': 'Dean', 'author_id': 3274152, 'author_profile': 'https://Stackoverflow.com/users/3274152', 'pm_score': 0, 'selected': False, 'text': '<p>How about modifying the Properties of the entity/table within the DataContext design surface within Visual Studio?</p>\n\n<p>For instance if I added a column to an SQL Server table:</p>\n\n<ol>\n<li>Open the *.dbml file.</li>\n<li>Right click the entity and select Add > Property.</li>\n<li>Fill out the values in the Properties window for the new column.</li>\n<li>Build your solution.</li>\n</ol>\n\n<p>The auto generated model classes should reflect the new column that was added.</p>\n\n<p><a href="https://i.stack.imgur.com/S2Ixq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/S2Ixq.png" alt="enter image description here"></a></p>\n\n<p><a href="https://i.stack.imgur.com/PMtq9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PMtq9.png" alt="enter image description here"></a></p>\n'}]
['https://Stackoverflow.com/questions/40022', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4048/']