简体   繁体   中英

How to add a column in table?

I have Silverlight 5 application. It uses Entity framework "Model first". I added new column in entity in .edmx file, but i have 11009 error "property is not mapped". Google said that for mapping the property must be already in the table, so how i can add it? I have never worked with Silverlight and C# before, and need some help..

UDT: Apparently i wrote question not correctly. I know, that i have to add column in database table, but how? I dont have access for this in "Model browser"

我可以用桌子做

  1. Delete
  2. Refresh model from DataBase
  3. Create database with the use of model (database is already existing *me)
  4. Add new code element
  5. Check
  6. Properties

UDT

I put the following code in XML.edmx file like Crud said

<Property Name="BPP" Type="varchar" MaxLength="19" /> in SSDL content <ScalarProperty Name="BPP" ColumnName="BPP" /> in CS mapping content

But now i have Error 2009: Property on conceptual side, which is part of MSL, doesn't exists in MetadataWorkSpace

You should add the new column in your database tables. After doing that update your edmx file.

If you already have the database so better to use DbFirst approch.it is easy to modify your model.in your case you can just update the database first ant simply you can update the model as well.

Any way if you want to alter the table with new column you should have to manually update the 2 of layers of edmx file.. Just open the edmx file as an xml and just add the inserted column details corresponding entity. You have to modify manually with the following layers.

  • SSDL content
  • CS mapping content

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM