Crystal Report错误无法启用约束

时间:2013-03-28 10:36:55

标签: c# .net

View_Atten_One_By_One mydataset1 = new View_Atten_One_By_One();

                    View_Atten_One_By_OneTableAdapters.DataTable1TableAdapter nfdAdapter1 = new View_Atten_One_By_OneTableAdapters.DataTable1TableAdapter();
                    nfdAdapter1.Fillattenbyemp(mydataset1.DataTable1, txtEmpId.Text);

                    ViewAttenByEmp nfpbdel1 = new ViewAttenByEmp();
                    nfpbdel1.SetDataSource(mydataset1);
                    crystalReportViewer1.ReportSource = nfpbdel1;

错误

无法启用约束。一行或多行包含违反非null,唯一或外键约束的值。

异常抛出此代码段

nfdAdapter1.Fillattenbyemp(mydataset1.DataTable1,txtEmpId.Text);

1 个答案:

答案 0 :(得分:0)

如果发生此类错误,请删除DataSet中的主键