---
title: "Database not working after updating the table in Visual studio 2012"  
description: "Database not working after updating the table in Visual studio 2012"  
author: "Simond Gear"  
published: 2016-03-25  
updated: 2016-03-25  
canonical: https://www.mindstick.com/forum/34076/database-not-working-after-updating-the-table-in-visual-studio-2012  
category: "asp.net mvc"  
tags: ["c#", "asp.net", "database", "asp.net mvc", "entity framework"]  
reading_time: 1 minute  

---

# Database not working after updating the table in Visual studio 2012

Hi All,I have getting [error after updating](https://answers.mindstick.com/qa/50819/how-to-fix-an-iphone-7-that-keeps-getting-wi-fi-error-after-updating-to-ios-11) [tables](https://www.mindstick.com/articles/336597/introduction-of-html-tables-for-web-development) directly in [sql server](https://www.mindstick.com/articles/12999/what-is-table-valued-function-in-sql-server) 2012, it will through error in my [MVC application](https://www.mindstick.com/forum/12932/how-to-consume-webservices-from-asp-dot-net-mvc-application). Error is below:\
Server Error in '/' Application. Invalid [column name](https://www.mindstick.com/forum/369/how-can-i-add-a-column-name-to-my-grid) 'Id'. Invalid column name 'Id'.

\

Here, My Table is below:

\

```
CREATE TABLE [dbo].[Course](       [ID] [int] IDENTITY(1,1) NOT NULL,       [Title] [nvarchar](50) NULL,       [Credits] [int] NOT NULL,       [DepartmentID] [int] NOT NULL, CONSTRAINT [PK_dbo.Course]
PRIMARY KEY CLUSTERED(       [ID] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE =
OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]
```

\

Please can [anyone](https://www.mindstick.com/articles/23207/how-to-find-the-best-fit-job-for-anyone) help.

\

Thank you.

\

## Replies

### Reply by Anupam Mishra

Hi Simond,\
If you are using edmx, Then follow the following steps:\
1. Open edmx diagram & Delete the **Course** table diagram 2. Add the **Course** table once again 3. save and build the application 4. Debug the project\
Otherwise, if you are using [CodeFirst Approach](https://www.mindstick.com/Articles/1424/code-first-approach-in-entity-framework) then, you need to update the database.


---

Original Source: https://www.mindstick.com/forum/34076/database-not-working-after-updating-the-table-in-visual-studio-2012

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
