Aneeq Azam Aneeq Azam - 1 year ago 131
ASP.NET (C#) Question

Visual Studio intellisense not working for newly added columns in database

I'm using SQL Server and made its connection with website in Visual Studio. Now I added three new columns in users table in database and there was error in SQL server that I solved by this link
SQL Server: Invalid Column Name
and now Visual Studio intellisense is not working for new columns as well giving me error doesn't contain definition for column name. Here is picture of that error in visual studio
error snapshot

1) I already closed and reopen vs but did't work.

2) Already refreshed data Connection in vs.

3) need detail about why its not getting those columns.

Answer Source

Open your edmx file by double clicking it from solution explorer. Right click in empty area of the edmx designer window as shown in the snapshot below. Go to Update Model From Database context menu option:

enter image description here

Now go to refresh tab and update the table in which you have added new columns as shown in the snapshot below. Entity framework will automatically pull the new columns as public properties of user class:

enter image description here

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download