C# .NET - Add port number to connection string in windows forms

Asked By Dom Afonso on 02-Jul-12 10:48 PM
I am using the above connection string with PORT NUMBER in windows application and it does not work!

    <add name="Remote.Properties.Settings.dbFilesConnectionString"
         connectionString="Data Source=tcp:,1434\SQLEXPRESS;Initial Catalog=dbFiles;User ID=Mile;Password=********;Connect Timeout=30;User Instance=False"
        providerName="System.Data.SqlClient" />

If I relace "tcp:,1434" with the windows form displays data but if the replacement is not done, it does not.
Does anyone know how to correctly include a port number in c# windows forms?
Robbe Morris replied to Dom Afonso on 02-Jul-12 11:01 PM
Remote connectivity in sql express is disabled by default:


Also, I'm pretty sure you do not need "tcp:" in your data source.  I also believe that port 1434 is the default for sql express.  So, you don't need that either.