private SqlDataConnection GetConnection() { MySqlConnectionParameters newMySqlConnectionParameters = new MySqlConnectionParameters("localhost", "purepos", "root", "root", "3306"); //CustomSqlDataConnection newMySqlConnectionParameters = new CustomSqlDataConnection("Default Connection", newMySqlConnectionParameters); return(new SqlDataConnection("PlazSales Connection", newMySqlConnectionParameters)); }
protected void ASPxDashboardViewer1_ConfigureDataConnection(object sender, DevExpress.DashboardWeb.ConfigureDataConnectionWebEventArgs e) { MySqlConnectionParameters param = e.ConnectionParameters as MySqlConnectionParameters; if (param != null) { param.DatabaseName = new InstanceConfigServices().GetConfig("dbname"); param.Password = new InstanceConfigServices().GetConfig("dbpws"); param.ServerName = new InstanceConfigServices().GetConfig("dbserver"); param.UserName = new InstanceConfigServices().GetConfig("dbuser"); } }
protected void dbvPrincipal_ConfigureDataConnection(object sender, DevExpress.DashboardWeb.ConfigureDataConnectionWebEventArgs e) { MySqlConnectionParameters parameters = e.ConnectionParameters as MySqlConnectionParameters; if (parameters != null) { parameters.ServerName = Session["server"].ToString(); parameters.Port = Session["porta"].ToString(); parameters.UserName = Session["user"].ToString(); parameters.DatabaseName = Session["banco"].ToString(); parameters.Password = Session["senha"].ToString(); } }