OK, so your connection string needs to be modified in code. That's simple string manipulation.
The easiest way to do it is to just replace a tag in the string with the IP address or host name:
Server={SERVER};Database=myDataBase;User Id=myUsername;
Password=myPassword;
string ipAddress = "192.168.0.1";
string connString = templateConnString.Replace("{SERVER}", ipAddress);