using System;
using System.Collections.Generic;
using System.Text;
namespace WmData {
///
/// WmDataBaseCredentials holds connectionstring information for a MySQL database
/// 20th oct 2007
///
public class WmDataBaseCredentials {
protected string hostname;
protected int portNumber;
protected string username;
protected string password;
protected string catalog;
public WmDataBaseCredentials(string hostname, int portNumber, string username, string password, string catalog) {
this.hostname = hostname;
this.portNumber = portNumber;
this.username = username;
this.password = password;
this.catalog = catalog;
}
public string Hostname {
get { return hostname; }
set { hostname = value; }
}
public int PortNumber {
get { return portNumber; }
set { portNumber = value; }
}
public string Username {
get { return username; }
set { username = value; }
}
public string Password {
get { return password; }
set { password = value; }
}
public string Catalog {
get { return catalog; }
set { catalog = value; }
}
///
/// Returns a useable connection string for MySqlConnection object
/// Please make sure all theproperties are set before calling this function
///
///
public string getConnectionString() {
return "server=" + hostname + ";" +
"port=" + portNumber + ";" +
"database=" + catalog + ";" +
"charset=utf8;" +
"uid=" + username + ";" +
"pwd=" + password + ";";
}
}
}