Hi,
I am trying to create a BizForm programmatically, however, my code fails to work. What am I doing wrong?
public void CreateBizFormTables()
{
string bizFormNamespace = "BizForm";
string tablename = "warehousecountry";
string className = bizFormNamespace + "." + tablename;
string defaultDateTime = DateTime.Now.ToString(CultureHelper.EnglishCulture.DateTimeFormat);
TableManager tm = new TableManager(ConnectionHelper.GetConnection().ConnectionString);
tm.DropTable(tablename);
tm.CreateTable(tablename, "warehousecountryid");
var dci = BizFormInfoProvider.CreateBizFormDataClass(className, "warehousecountry", tablename, "warehousecountryid");
tm.AddTableColumn(tablename, "FormInserted", "datetime", false, defaultDateTime);
tm.AddTableColumn(tablename, "FormUpdated", "datetime", false, defaultDateTime);
tm.AddTableColumn(tablename, "WarehouseCountry", "nvarchar", true, null);
tm.AddTableColumn(tablename, "WarehouseID", "nvarchar", true, null);
DataClassInfoProvider.SetDataClass(dci);
FormHelper.UpdateInheritedClasses(dci);
CMS.DataEngine.SqlGenerator.GenerateDefaultQueries(dci, true, true);
}