ConstraintException after EnforceConstraints in C# datasets -


based on pseudo-code below please tell me if can somethig or better reload dataset in case of constraint failure?

thanks!

var mydataset = new datatypeddataset(); // dataset has tables parentchild , foreightkey relationships try{       mydataset.enforceconstraints = false;       loaddataset(medataset); // method fills schema data violates given schema constraints       mydataset.enforceconstraints = true; } catch(constraintexception ce){       logconstraintexception(ce);//some logging       mydataset.enforceconstraints = false; }   // suppose have = {1}, b = { {a=2, 2}, {a=1,2}} try{       var arow = mydataset.tableb.first().arow;  } catch(??/*what type of exception here?*/ exception) {   // hm... pitty   letsplayfailuretollerantscenario(mydataset.tableb.first(), mydataset.tablea); }  var rows = mydataset.tablea.getbrows();  

so after tests turned out technically possible. honest happier if task more strict in regards of data constraints, because finding error in under such implemetation not peace of cake.


Comments

Popular posts from this blog

design - Custom Styling Qt Quick Controls -

Unable to remove the www from url on https using .htaccess -