What is the best way to re-name a column in edmx?

偶尔善良 提交于 2019-12-02 01:34:32

问题


I am using entity framework 4.0 my approach is Database first approach. what is the best way to rename a column name or change the data type of column in edmx.

thanks in advance.


回答1:


To rename a column:

  1. Rename the column in SQL Management Studio.
  2. In the EDMX editor, choose "Update from Database", and complete the wizard. You will get a new column with the updated name, and an error-message saying that the old column is not mapped.
  3. Remove the old column.

To change the datatype:

  1. Update the datatype in SQL Management Studio.
  2. In the EDMX editor, choose "Update from Database", and complete the wizard. You will get an error message saying that the mapping is invalid.
  3. Change the datatype of the column to match what you chose in SQL Management Studio.


来源:https://stackoverflow.com/questions/16535313/what-is-the-best-way-to-re-name-a-column-in-edmx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!