I am using code similar to the following:
Database.AddColumn(
"TableName",
new Column(
"ColumnName",
DbType.String,
ColumnProperty.NotNull,
"TypeName"));
But I am getting error as "TypeName" is not allowed in this context, allowed context are constants, constants expression but no column name.
For strings, you have to put single quotes around the default value as the
ALTER
statement is built with it directly. Try this: