我不确定为什么不能编写以下代码。
var listPerson = new List<PERSON>();
using (var t = DbContext.SingleInstance().Entities)
{
listPerson.AddRange(t.PERSON);
}
using(var personInformation=DbContext.SingleInstance().TKEntities)
{
foreach(var p in listPerson)
{
personInformation.PERSON.Add(p);
}
personInformation.SaveChanges();
}
PERSON TABLE : PersonID,NAME,SURNAME,PERSONFAMILYID,PERSONCOURSEID
PERSONFAMILY TABLE:PersonID,PERSONFAMILYID,PERSONFAMILYNAME,PERSONFAMILYSURNAME
PERSONCOURSE TABLE: PERSONID,COURSEID,COURSENAME
PERSONTABLE-PERSONFAMILY IS ONE TO MANY
PERSONTABLE-PERSONCOURSE IS ONE TO MANY.
我收到标题中给出的错误。有人可以帮我吗?
答案 0 :(得分:2)
它应该是带有引号format
的字符串
as.Date(as.character(20110505), "%Y%m%d")
#[1] "2011-05-05"