private void BindData() { int numDuration = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["ChartDataDuration"]); DataTable dt = new DataTable(); cloud.w_SQLDatabasesFileSize(ServerNum, numDuration); dt = cloud.dsReturn.Tables[0]; DataTable dt_Latest = cloud.dsReturn.Tables[0].Clone(); var groupDatatable = from tbl in dt.AsEnumerable() group tbl by new { DatabaseName = tbl["DatabaseName"] } into groupby select new { value = groupby.Key , maxDate = groupby.Max(e => e.Field <DateTime>("TimeIn")) , columnvalue = groupby , }; foreach (var key in groupDatatable) { var lastTime = key.maxDate; foreach (var col in key.columnvalue) { if (lastTime.ToString() == col["TimeIn"].ToString()) { // DataRow dr = col; dt_Latest.ImportRow(col); } } } gv_List.DataSource = dt_Latest; gv_List.DataBind(); int maxValue = Convert.ToInt32(dt.Compute("max(Total_Databases_Size_MB)", string.Empty)); DataTable dt_TotalDatabase = Lib.ConvertingProc.Pivot(dt, "databaseName", "TimeIn", "Total_Databases_Size_MB"); strColumn_TotalDatabase = Lib.ConvertingProc.GetColumname(dt_TotalDatabase.Columns); DataTable dt_DataFileSize = Lib.ConvertingProc.Pivot(dt, "databaseName", "TimeIn", "Datafile_Size_MB"); strColumn_DataFileSize = Lib.ConvertingProc.GetColumname(dt_TotalDatabase.Columns); DataTable dt_LogSize = Lib.ConvertingProc.Pivot(dt, "databaseName", "TimeIn", "Log_Size_MB"); strColumn_LogSize = Lib.ConvertingProc.GetColumname(dt_TotalDatabase.Columns); DataTable dt_TotalVlfCount = Lib.ConvertingProc.Pivot(dt, "databaseName", "TimeIn", "Total_vlf_Cnt"); strColumn_TotalVlfCount = Lib.ConvertingProc.GetColumname(dt_TotalDatabase.Columns); DataTable dt_ActiveVlfCount = Lib.ConvertingProc.Pivot(dt, "databaseName", "TimeIn", "Active_vlf_Cnt"); strColumn_ActiveVlfCount = Lib.ConvertingProc.GetColumname(dt_TotalDatabase.Columns); //챠트바인드 List <Lib.chartProperty> cplst = new List <Lib.chartProperty>(); StringBuilder sb = new StringBuilder(); cplst = SetChartProperty(); cplst = Lib.Flotr2.SetArrayString_Lines(dt_TotalDatabase, cplst); cplst = Lib.Flotr2.SetArrayString_Lines(dt_DataFileSize, cplst); cplst = Lib.Flotr2.SetArrayString_Lines(dt_LogSize, cplst); cplst = Lib.Flotr2.SetArrayString_Lines(dt_TotalVlfCount, cplst); cplst = Lib.Flotr2.SetArrayString_Lines(dt_ActiveVlfCount, cplst); sb = Lib.Flotr2.SetStringValue(cplst, sb, ServerNum.ToString()); litScript_Pop.Text += Lib.Util.BoxingScript(sb.ToString()); }