我正在尝试向表中添加一行:
MYDataContext dc = new MYDataContext("MYConnectionString");
using (MYDataContext db = new MYDataContext("MYConnectionString"))
{
NotificationLog n = new NotificationLog();
n.result = result;
n.context = message;
n.tomobiles = phoneprefix + phone;
n.datesent = DateTime.Now;
n.SMSprovider = provider;
db.InsertOnSubmit(n);
db.SubmitChanges();
}
但我得到这个错误:
“MYDataContext”不包含“InsertOnSubmit”的定义,并且找不到接受“MYDataContext”类型的第一个参数的扩展方法“InsertOnSubmit”(您是否缺少 using 指令或程序集引用?)
我该如何解决?