Answer for your question is
connection string, with the help of connection string you can connection to any database in your network
look at below connection string for MYSQL
Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
Specifying TCP port
Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername;
Pwd=myPassword;