Azavea.Open.DAO.SQLServer.SQLServerDescriptor.MakeConnectionString C# (CSharp) Method

MakeConnectionString() public static method

Assembles a connection string that can be used to get a database connection. All the parameters are optional for the purposes of this method, although obviously it would be possible to create a useless connection string if you leave out important parameters.
public static MakeConnectionString ( string server, string database, string user, string password ) : string
server string Server name that is hosting the database
database string Database name on the server.
user string User name to use when accessing the db.
password string Password for above user.
return string
        public static string MakeConnectionString(string server,
            string database, string user, string password)
        {
            string connStr = "";

            // Assemble the string.  Only include parameters that have values.
            if (StringHelper.IsNonBlank(server))
            {
                connStr += "server=" + server + ";";
            }
            if (StringHelper.IsNonBlank(user))
            {
                connStr += "uid=" + user + ";";
            }
            if (StringHelper.IsNonBlank(password))
            {
                connStr += "pwd=" + password + ";";
            }
            if (StringHelper.IsNonBlank(database))
            {
                connStr += "database=" + database + ";";
            }
            return connStr;
        }