Are only the relevant ConnectionState enumeration values โ€‹โ€‹open and closed?

The ConnectionState MSDN page says: "This value is reserved for future versions of the product" for all values โ€‹โ€‹except Open and Closed. What does this mean? Are other values โ€‹โ€‹used?

However, from this, https://stackoverflow.com/a/16626960/ appears to be using ConnectionState.Broken as well.

+3
source share
1 answer

After spending some time at Reflector, it seems to me that the Broken and Fetching states are also used in at least one or two places. Best coding practice would be to suggest that any of the values โ€‹โ€‹can be used and protect the code. For example, if you need to know if a connection is open, check the state == Open, and not the state! = Closed.

+1
source

Source: https://habr.com/ru/post/1698857/


All Articles