G
Guest
Is there any way to create a new column in a dataset table from 2 string
column and a int column? I got an error "expecting string" from my code
below. Any help would be appreciated.
DataColumn scc1 = new
DataColumn("CodeLength",Type.GetType("System.String"));
scc1.Expression = "iif(len(CycleLength) > 0,CycleCode + ' - ' +
CycleLength,CycleCode)";
dsSchTables.Tables["ServiceCycle"].Columns.Add(scc1);
dsSchTables.AcceptChanges();
DataColumn scc2 = new
DataColumn("CodeLengthUnit",Type.GetType("System.String"));
scc1.Expression = "iif(len(CycleUnit) > 0,CodeLength + ' - ' +
CycleUnit,CodeLength)";
dsSchTables.Tables["ServiceCycle"].Columns.Add(scc2);
dsSchTables.AcceptChanges();
column and a int column? I got an error "expecting string" from my code
below. Any help would be appreciated.
DataColumn scc1 = new
DataColumn("CodeLength",Type.GetType("System.String"));
scc1.Expression = "iif(len(CycleLength) > 0,CycleCode + ' - ' +
CycleLength,CycleCode)";
dsSchTables.Tables["ServiceCycle"].Columns.Add(scc1);
dsSchTables.AcceptChanges();
DataColumn scc2 = new
DataColumn("CodeLengthUnit",Type.GetType("System.String"));
scc1.Expression = "iif(len(CycleUnit) > 0,CodeLength + ' - ' +
CycleUnit,CodeLength)";
dsSchTables.Tables["ServiceCycle"].Columns.Add(scc2);
dsSchTables.AcceptChanges();