I am trying to insert some rows into a custom table during the component migration but am getting the error below
[BootFailedException: Boot failed: Umbraco cannot run. See Umbraco's log file for more details.
-> Umbraco.Core.Exceptions.BootFailedException: Boot failed.
-> System.Data.SqlServerCe.SqlCeException: The column name is not valid. [ Node name (if any) = ,Column name = Id ]
Is this possible? If so what am I doing wrong?
Here is the code I'm trying.
if (TableExists("VantageConfig"))
{
var newrow1 = new VantageConfigDataSchema
{
Group = "1-CRM",
Name = "CRMAddress",
Label = "Dynamics Url",
Type = 0
};
Insert.IntoTable("VantageConfig").Row(newrow1).Do();
}
This is my datascheme (used to create the table)
public class VantageConfigDataSchema
{
[PrimaryKeyColumn(AutoIncrement = true, IdentitySeed = 1)]
[NPoco.Column("C_ID")]
public int Id { get; set; }
[NPoco.Column("C_Name")]
public string Name { get; set; }
[NPoco.Column("C_Value")]
public string Value { get; set; }
[NPoco.Column("C_Label")]
public string Label { get; set; }
[NPoco.Column("C_Encrypted")]
public bool Encrypted { get; set; }
[NPoco.Column("C_GROUP")]
public string Group { get; set; }
[NPoco.Column("C_TYPE")]
public int Type { get; set; }
}
After a lot of fiddling around I managed to get it to work by creating the row as below using a dynamic object, seems it wants the actual column names not the fields from the Npoco Class
Inserting data in custom table using migration
I am trying to insert some rows into a custom table during the component migration but am getting the error below
Is this possible? If so what am I doing wrong?
Here is the code I'm trying.
This is my datascheme (used to create the table)
After a lot of fiddling around I managed to get it to work by creating the row as below using a dynamic object, seems it wants the actual column names not the fields from the Npoco Class
is working on a reply...