1

这是我的代码

        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。请检查它给我建议。谢谢。

4

0 回答 0