I'm 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;
//DbContext.Set(entity.GetType()).Add (entity);
DbContext.SaveChanges();
}
When I do this I get the following error:
{"Invalid column name 'Custom.MonsterBehandeling'."}
The examples of this error that I can find are all about trying to select data from a database where the column that they try to select doesn't exist, so I thought that I'm trying to insert in column Custom.MonsterBehandeling
without that column existing. Indeed, looking in the database the "Test" table does not have a Custom.MonsterBehandeling.
However, the entity Test
does not contain either Custom
, MonsterBehandeling
or Custom.MonsterBehandeling
. Searching for MonsterBehandeling
in the whole solution only gives two hits:
<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'm not using, removing it still gives the same error, and
<field name="ItemExpression" value="Sample.Custom.MonsterBehandeling"/>
in a configuration.xml file. Also after removing this 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 if why I think that I get this error is correct. So, what causes an {"Invalid column name '...'."}
error when inserting data, and what can I do to solve this?