I haven't done a 9.5 to 9.6 upgrade, but i had a similar issue on a previous upgrade. I had to specify the instance and port in the connection string.
ServerName\InstanceName, Port
For example if you are using sql express, it is usually: ServerName\LDMSDATA, 1433