I have my TCP port number, credentials and an IP address. How do I apply all of this to an app.config file to make it link to my database on another computer? I would like to apply it to my app.config file.
Answer
connectionString="Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;"/>
The key is the Network Library=DBMSSOCN; which tells your code to connect using TCP/IP. 1433 is the defualt port used by SQL Server (assuming your database is SQL Server). TCP/IP is often the best for a firewalled environment.
No comments:
Post a Comment