0
mcard_list mcardlist = new mcard_list();
numberoftimes = 0;
timesheet.AddTomcard_list(mcardlist);
while (numberoftimes < collectionnumbers)
{
var FieldName = mcardlistfields[numberoftimes, 0].ToString();
var FieldType = mcardlistfields[numberoftimes, 1].ToString();
switch (FieldType)
{
case "String" :
mcardlist. + FieldName = "Test"; <=I know wrong here but i don't know how to do.
break;
case "DateTime" :
mcardlist. + FieldName = "2015-1-23"; <=I know wrong here I don't know how to do it.
break;
}
numberoftimes += 1;
}
timesheet.SaveChanges();
任何人都可以幫助我如何可以添加存儲在變量「字段名」供以後使用附加字段名「mcardlist。」 (以點結尾)。謝謝。附加的局部變量,實體表,隨後與替代