Changed a SQL table? Need to update your LINQ2SQL class?

September 9, 2009

Ok, so you have table (class) on your Linq2SQL surface. You decide to remove/add/rename one of the fields in the mapped SQL table.

Build your app – Blam, no go!

So – You have two choices, Find the class/table on your Linq2SQL surface and…

a) Replicate the change (Right click the associated field and select ‘properties’ or left click and hit delete to kill it!

b) Delete the table entirely, drag it from server explorer again. Before you re-add the table, you’ll need to refresh the SQL tables list in server explorer (Right click tables and hit ‘refresh’) note that refreshing the table itself will not work!

Which option you go for depends on how much you have customised the associated Linq2SQL class since you first added it.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: