using DevExpress.XtraCharts;
using MySql.Data.MySqlClient;
using MySqlX.XDevAPI.Relational;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraCharts;
using DevExpress.Charts.Native;
namespace WindowsFormsApp1
{
public partial class FormSendReport : Form
{
public FormSendReport()
{
InitializeComponent();
}
string ConString = "Server=127.0.0.1;Database=r506;Uid=root;ConvertZeroDateTime=True;";
private void FormSendReport_Load(object sender, EventArgs e)
{
MySqlConnection cnn = new MySqlConnection(ConString);
DataSet ds = new DataSet();
string sql = "SELECT e.HSERV,COUNT(*) as c " +
"FROM epe0 e " +
"GROUP BY e.HSERV";
MySqlDataAdapter da ;
try
{
cnn.Open();
da = new MySqlDataAdapter(sql, cnn);
da.Fill(ds);
// Create a pie series.
DataTable dt = new DataTable() { TableName = "Table" };
ds.Tables.Add(dt);
gridControl1.DataSource = ds.Tables[0].DefaultView;
chart1.DataSource = ds;
chart1.SeriesDataMember = "Table";
chart1.Series.Add(ISeries);
chart1.Series 1 = "HSERV";
s1.ValueDataMembers[0] = "c";
this.Controls.Add(chart);
chart.DataBind();
}
catch (Exception ex)
{
MessageBox.Show("Can not open connection ! " + ex.Message);
}
}
}
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น