我有一个 WPF 应用程序,当我运行 Select distinct query 时出现错误
Failed to enable constraints.
One or more rows contain values violating non-null, unique, or foreign-key constraints.
.cs 代码:
Saman.DatabaseDataSet databaseDataSet = ((Saman.DatabaseDataSet)(this.FindResource("databaseDataSet")));
// Load data into the table Employee. You can modify this code as needed.
Saman.DatabaseDataSetTableAdapters.PartsTableAdapter databaseDataSetPartsTableAdapter = new Saman.DatabaseDataSetTableAdapters.PartsTableAdapter();
databaseDataSetPartsTableAdapter.FillBy(databaseDataSet.Parts);
System.Windows.Data.CollectionViewSource partsViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("partsViewSource")));
partsViewSource.View.MoveCurrentToFirst();
查询是
Select DISTINCT Category from Parts