Click here to Skip to main content
15,887,875 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
.

as i can't post images here i have asked same question in stack-overflow so that i can link it here for you.

c# - Using scalar query as data source for winform chart - Stack Overflow[^]

What I have tried:

and here is form load event code

private void FrmDashBoard_Load(object sender, EventArgs e)
        {
            
            this.mSdiesTableAdapter1.Fill(this.trialDataSet2.MSdies.);
            


            this.reportViewer1.RefreshReport();
        }
Posted
Comments
[no name] 6-Aug-20 1:58am    
A data point needs at least 2 values; a series needs multiple data points.
Member 14898617 6-Aug-20 2:05am    
I didn't get you(could you please explain further?) , the columns "Size in mg" in the query can be used as series right? then for y axis i can use total column , my question is how to make this scalar query as data source to my chart .
[no name] 6-Aug-20 10:55am    
And for the "x" value? Even then, a single point is meaningless in relation to nothing else.
Member 14898617 6-Aug-20 23:37pm    
Thank you very much for your reply , but X value is not a single pint here
this is the scalar query output:
Size_in_mg(X axis)--------- Count(of Size_in_mg)(Y-axis)
100-300mg --------- 3
200-400mg --------- 2
300-500mg --------- 1

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900