The 1151 socket has two versions. Your i3-7100 is a Kaby Lake generation CPU that uses the original 1151 socket version.
The i9-9900K and all other Coffee Lake generation CPUs use a new version of the 1151 socket that is not compatible. This version is often referred to as "1151-2".
The "1151" in the socket name is the number of pins ...
Intel cpu's can only upgrade one generation on the same motherboard, and the 7th generation is already the "upgrade" of the 6th generation. They are similar socket though and there are motherboards that allow 6th to 9th gen upgrade, but those are rare.