private DataTable BindTableForChart(DataTable dtChartPram)
{
try
{
dtForChartBinding = new DataTable("dtForChartBinding");
DataTable dtForChart = new DataTable("dtForChart");
dtForChart.Columns.Add("DateOnly", typeof(string));
dtForChart.Columns.Add("Series 1", typeof(double));
if (dtChartPram != null && dtChartPram.Rows.Count > 0)
{
for (int kCount = 0; kCount < dtChartPram.Rows.Count; kCount++)
{
DataRow dr = dtForChart.NewRow();
dr["DateOnly"] = dtChartPram.Rows[kCount]["DateOnly"] != DBNull.Value ? dtChartPram.Rows[kCount]["DateOnly"] : string.Empty;
dr["TimeOnly"] = dtChartPram.Rows[kCount]["TimeOnly"] != DBNull.Value ? dtChartPram.Rows[kCount]["TimeOnly"] : string.Empty;
dr["Series 1"] = dtChartPram.Rows[kCount]["Series 1"] != DBNull.Value ? Convert.ToDouble(dtChartPram.Rows[kCount]["Series 1"]) : dr["Series 1"] = DBNull.Value;
dtForChart.Rows.Add(dr);
}
}
return dtForChartBinding;
{
try
{
dtForChartBinding = new DataTable("dtForChartBinding");
DataTable dtForChart = new DataTable("dtForChart");
dtForChart.Columns.Add("DateOnly", typeof(string));
dtForChart.Columns.Add("Series 1", typeof(double));
if (dtChartPram != null && dtChartPram.Rows.Count > 0)
{
for (int kCount = 0; kCount < dtChartPram.Rows.Count; kCount++)
{
DataRow dr = dtForChart.NewRow();
dr["DateOnly"] = dtChartPram.Rows[kCount]["DateOnly"] != DBNull.Value ? dtChartPram.Rows[kCount]["DateOnly"] : string.Empty;
dr["TimeOnly"] = dtChartPram.Rows[kCount]["TimeOnly"] != DBNull.Value ? dtChartPram.Rows[kCount]["TimeOnly"] : string.Empty;
dr["Series 1"] = dtChartPram.Rows[kCount]["Series 1"] != DBNull.Value ? Convert.ToDouble(dtChartPram.Rows[kCount]["Series 1"]) : dr["Series 1"] = DBNull.Value;
dtForChart.Rows.Add(dr);
}
}
return dtForChartBinding;