Your connection is timing out.. or rather isn't timing out... and that is why the app is hanging. You are opening the connection to the server on the UI thread and it isn't able to connect to your datasource so it is making your application hang while it is trying to connect. I think the default timeout is 3 minutes... if you wait that long it should, finally, throw an exception. If you aren't that patient, you can set the ConnectionTimeout property of the sqlConnection object before you call the Open method, then the method will timeout sooner if it can't connect to the datasource.
If connectivity to your datasource will be intermittent, then you should consider moving the connection management to a non-UI thread so the delays in opening a SQL connection are hidden from the user.
As to why it can't connect, that is another issue and it is highly dependent on what you are connecting to. Unfortunately, 'xyz' doesn't tell us much so I can't help you there.