无法启用约束

时间:2012-08-07 05:33:33

标签: c# sql-server winforms ado.net

  

可能重复:
  Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints

我在加载事件中写了这段代码:

private DataSet1 ds1 = new DataSet1();
private SqlDataAdapter da1 = new SqlDataAdapter();
ds1.Clear();
da1 = new SqlDataAdapter("select * from Département, division,Sérvice where Département.Num_Département = Division.Num_Département_Département and Sérvice.Num_Division_Division = Division.Num_Division", sql.cn);
da1.Fill(ds1, "Sérvice");
da1.Fill(ds1, "Division");
da1.Fill(ds1, "Département");

但是当我运行表单时它会给我这个错误:

  

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

我该怎么办?

0 个答案:

没有答案