I need to compose a SQL Server connection string on-the-fly in my C# code and I was curious if there's a built-in way of doing it? So far I have this:
string connectionString = "Server=" + server +
"; Database=" + db +
"; User Id=" + userName +
"; password=" + pass +
"; Connection Timeout=15";
And also, do I need to include all names in double quotes as such?
string connectionString = "Server=\"" + server +
"\"; Database=\"" + db +
"\"; User Id=\"" + userName +
"\"; password=\"" + pass +
"\"; Connection Timeout=15";