while loop check first condition if it is satisfied then it will run further. Do-while loop initially skip first time condition check and start running but very second time it will check condition and start running.
sqlconnection con=new sqlconnection(@connectionstring);int i=0; while(connection is open) { i++; } it is increment and check condition.int i=0; do { i++; }while(connection is open)