这是我的代码
using (BatchDashboardDataContext db = new BatchDashboardDataContext())
{
TBatchDashboard b = new TBatchDashboard();
b.Id = deletedBatchId;
db.TBatchDashboards.Attach(b);
db.TBatchDashboards.DeleteOnSubmit(b);
db.SubmitChanges();
}
Id是TBatchDashboard
表的主键。还有一个记录deletedBatchId
值作为TBatchDashboard
表中的主键。
请检查它给我建议。
感谢。