I am new to use DevExpress methods to create a Dashboard for web application on asp.net. I am not getting a good enough example in DashboardLoading method from DevExpress of how to get data directly from MS SQL Server. Have anyone successfully and have a example code for that? It seems like they are using XML, txt, or other kind of files to get data to put in Dashboard. I don't want that. One of them mentioned to use Stream but it required to create a filestream in database and that's not what I am looking for. Here is example from DevExpress that was for xml, http://www.devexpress.com/Support/Center/Example/Details/E4761.
Here is my example so far,
public partial class Viewer : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string uid = AD.GetUserID() + "_p";
Tin.ActiveDirectory.ADSearch ad = new Tin.ActiveDirectory.ADSearch("tdcc");
if (ad.Check_If_Member_Of_AD_Functional_Group(uid, "NEACntrlRmAdm-G") | ad.Check_If_Member_Of_AD_Functional_Group(uid, "NEAWinAdm-G"))
{
//authorized
}
else
{
//Response.Redirect("Denied.asp")
}
ASPxDashboardViewer1.DashboardId = "MirrorDashboard";
}
protected void ASPxDashboardViewer1_DashboardLoading(object sender,
DevExpress.DashboardWeb.DashboardLoadingEventArgs e)
{
//check the identifier of the required dashboard
if(e.DashboardId == "MirrorDashboard")
{
//To get data from SQL Serve to load the Dashboard
}
}
protected void ASPxDashboardViewer1_ConfigureDataConnection(object sender, DevExpress.DashboardWeb.ConfigureDataConnectionWebEventArgs e)
{
//System.Data.SqlClient.SqlConnection sqlConn = new System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings["GM"].ConnectionString);
var parameters = e.ConnectionParameters as MsSqlConnectionParameters;
if (parameters != null)
{
parameters.AuthorizationType = MsSqlAuthorizationType.SqlServer;
parameters.DatabaseName = "GM";
parameters.ServerName = "*****";
parameters.UserName="****";
parameters.Password="****";
}
}
}