c# - Show Form depending on database condition -
on initial startup of application looking check whether table
within database
has tuples within it, if condition true not want adddialog
form show when false show it. appreciated.
this have tried:
private void home_loaded_1(object sender, routedeventargs e) { //addsafelimits dialog = new addsafelimits(); //dialog.show(); var query = level in context.safelimits level.upperlimit == null select level; levels = query.tolist(); if (levels== null) { addsafelimits dialog = new addsafelimits(); dialog.show(); } }
i think linq return empty instead of null can try use:
if (levels== null||levels.count==0) { addsafelimits dialog = new addsafelimits(); dialog.show(); }