Which should be selected?
Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;
or
Data Source=190.190.200.100;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;
It depends – if your SQL Server runs on absolutely everything with their default settings, then you don’t need to specify neither the port, nor the protocol to use.
Just use:
That should be enough.
If your server has custom settings, e.g. uses a custom port – then you must add that to your connection string, of course.
For a great many samples and explanations, see connectionstrings.com
PS: I personally would use
since I find
ServerandDatabasemuch clearer and more obvious thanData SourceandInitial Catalog– from a functionality point of view, those two connection strings are identical (for SQL Server)