I am getting this error on a routine which uses reflection to dump some object properties, something like the code below.
MemberInfo[] members = obj.GetType(         
        
Firstly, you've made in incorrect assumption, that is, you've assumed that members has returned the members of an instance of System.Data.SqlClient.SqlConnection, which it has not.  What has been returned are the members of an instance of System.Type.
From the MSDN documentation for DeclaringType:
Getting the
DeclaringMethodproperty on a type whoseIsGenericParameterproperty is false throws anInvalidOperationException.
So... it's understandable that an InvalidOperationException is being thrown, since naturally, you're not dealing with an open generic type here. See Marc Gravells answer for an explanation of open generic types.