本文介绍了如何将实时图表连接到sqlserver的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

初学者在这里

i尝试将它连接到VS的标准图表工具

但它似乎无法连接到实时图表



我尝试了什么:



SqlDataAdapter ad = new SqlDataAdapter(选择SmBagDatePurchased,SUM(Cast( SmBagNetSales as money))作为来自SMBagsSalesTb组的SmBagNetSales由SmBagDatePurchased,sqlCon);

DataTable dt = new DataTable();

ad.Fill(dt);

cartesianChart1.Datasource = dt;

chart1.ChartAreas [ChartArea1]。AxisX.Title =SmBagDatePurchased;

chart1.ChartAreas [ ChartArea1] .AxisX.Title =SmBagNetSales;



chart1.Series [Series1]。XValueMember =SmBagDatePurchased;

chart1.Series [Series1]。YValueMembers =SmBagNetSales;

beginner here
i tried it connecting it to the standard chart tool of VS
but it seems doesn't connect to live charts

What I have tried:

SqlDataAdapter ad = new SqlDataAdapter("select SmBagDatePurchased,SUM(Cast(SmBagNetSales as money)) as SmBagNetSales from SMBagsSalesTb group by SmBagDatePurchased", sqlCon);
DataTable dt = new DataTable();
ad.Fill(dt);
cartesianChart1.Datasource = dt;
chart1.ChartAreas["ChartArea1"].AxisX.Title = "SmBagDatePurchased";
chart1.ChartAreas["ChartArea1"].AxisX.Title = "SmBagNetSales";

chart1.Series["Series1"].XValueMember = "SmBagDatePurchased";
chart1.Series["Series1"].YValueMembers = "SmBagNetSales";

推荐答案


这篇关于如何将实时图表连接到sqlserver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-16 23:23