/* DataSet hell - "Failed to enable constraints. One or more rows contain values...." */
使用DataSet的时候遇到这么个错误:Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
"One or more"到底是什么,不知道。
找到错误的方法是,使用DataTable的GetErrors方法
http://msdn.microsoft.com/en-us/library/system.data.datatable.geterrors(VS.71).aspx
检查DataSet中的所有DataTable的HasErrors属性,然后对有错误的DataTable使用GetErrors方法。GetErrors返回一组DataRows,检查返回的所有DataRow的RowError属性来获得确切的错误信息。