ExecuteNonQuery requires an open and available Connection. The connection\'s current state is closed.
What am I doing wrong here? I\'m assuming you can
It appears you are doing a read before doing your ExecuteNonQuery. In your first call to SqlCommand (for the SELECT), you are closing the connection after the read is complete.
SqlDataReader rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
Remove the command behavior, you should be good to go, or re-open the connection in your next if statement.
This
SqlDataReader rdr = cmd.ExecuteReader();
Or this
if (rowsReturned == true){
cn.open();