if (FileUpload1.HasFile)
{
FileUpload1.SaveAs((Server.MapPath("~/PicUpload/") + FileUpload1.FileName));
}
MasterPackEntities obj = new MasterPackEntities();
news NewNews = new news()
{
title = tbtitle.Text,
details = Editor1.Content,
NewsImage = ("~/PicUpload/") + FileUpload1.FileName
};
obj.news.addObject(NewNews);
obj.SaveChanges();
不包含“ ”的定义,并且找不到接受“ ”类型的第一个参数的AddObject
扩展方法“ ”AddObject
System.Data.Entity.DbSet