I am trying to add an entity to my database with the following code:
public void StoreElectronicSignatureType(ElectronicSignatureTypeModel model) { [...] ElectronicSignatureType electronicSignatureType = new ElectronicSignatureType(); Entity entity = GetEntity("Test"); electronicSignatureType.Entity = entity; Add(electronicSignatureType); public void Add(object entity) { DbContext.Entry(entity).State = System.Data.EntityState.Added;
When I do this, I get the following error:
{"Invalid column name 'Custom.MonsterBehandeling'."}
Examples of this error that I can find are all attempts to select data from a database where the column they are trying to select does not exist, so I thought that I was trying to insert Custom.MonsterBehandeling into the column without this column. Indeed, looking at the database, the Test table does not have Custom.MonsterBehandeling.
However, the Test object contains neither Custom , MonsterBehandeling , nor Custom.MonsterBehandeling . Finding MonsterBehandeling in the whole solution gives only two clicks:
<CustomTable Name="Sample"> <Columns> <ColumnDefinition IsUnique="false" IsDiscriminator="false" IsIdentity="false" Description="Monster behandeling" Size="0" Precision="0" Scale="0" DataType="Text" Name="MonsterBehandeling" IsPrimaryKey="false" AllowNull="true" /> </Columns> </CustomTable> <field name="ItemExpression" value="Sample.Custom.MonsterBehandeling"/>
In a database schema that I am not using, deleting it still gives the same error, and
<field name="ItemExpression" value="Sample.Custom.MonsterBehandeling"/>
in the configuration.xml file. Also, after uninstalling, I still get the same error.
Seeing that I canβt even find MonsterBehandeling in the database or in my solution, I have no idea where to start looking for a solution. Also, I'm not sure why I think I am getting this error correctly. So what causes the {"Invalid column name '...'."} Error when inserting data and what can I do to solve this problem?