Using C#, I need to build a connection string from a few AppSettings. If I do this:
Connection = string.Format("Data Source={0};Initial Catalog={1);User Id={2};Password={3};",
ConfigurationManager.AppSettings.Get("CartServer"),
ConfigurationManager.AppSettings.Get("CartDatabase"),
ConfigurationManager.AppSettings.Get("CartUserName"),
ConfigurationManager.AppSettings.Get("CartPassword"));
I get an invalid format string exception. I narrowed it down to the "Password=" part of the format string (ie, "Passwork=" works). There's an easy enough work-around:
Connection = string.Format("Data Source={0};Initial Catalog={1);User Id={2};{3}={4};",
ConfigurationManager.AppSettings.Get("CartServer"),
ConfigurationManager.AppSettings.Get("CartDatabase"),
ConfigurationManager.AppSettings.Get("CartUserName"),
"Password",ConfigurationManager.AppSettings.Get("CartPassword")); // Lame!!!
But what's the real story with the "Password"? I checked MSDN and a few other sites but came up empty. Oh, if it matters, this is a WCF service.