Hello all , i am very new to c# visual studio ,In my winforms app i have created a dataset from Trial.Accdb database & in it i have added a Scalarquery() which return count of 1 particular column , now i want to use this query as data-source to show as a chart in my winform .Please help me how to achieve this

and here is form load event code
Code:
private void FrmDashBoard_Load(object sender, EventArgs e)
        {
            
            this.mSdiesTableAdapter1.Fill(this.trialDataSet2.MSdies.);
            


            this.reportViewer1.RefreshReport();
        }

Name:  sql select.jpg
Views: 47
Size:  30.6 KBName:  target datasource.jpg
Views: 43
Size:  32.9 KBName:  chart details.jpg
Views: 43
Size:  27.8 KB

Or based on the above requirement i am not able modify the below code to full fill the same requirement:
Code:
private void Form1_Load(object sender, EventArgs e)
        {
            chart1.Series.Clear();
            var series1 = new System.Windows.Forms.DataVisualization.Charting.Series
            {
                Name = "Series1",
                Color = System.Drawing.Color.Green,
                IsVisibleInLegend = false,
                IsXValueIndexed = true,
                ChartType = SeriesChartType.Line
            };

            this.chart1.Series.Add(series1);

            for (int i = 0; i < 1000; i++)
            {
                series1.Points.AddXY(i, Result(i));
            }
            chart1.Invalidate();
        }

        private int Result(int i)
        {
            var result = 20 * i + i * i;
            return result;
        }