Click here to Skip to main content
15,921,467 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I'm having alot of trouble getting my chart
to display data form a sql table. This is the code I used:

C#
clsConnection sqlconn = new clsConnection();
                SqlCommand sqlcomm = new SqlCommand();

                sqlcomm.Connection = sqlconn.connection;
                sqlcomm.CommandType = CommandType.StoredProcedure;
                sqlcomm.CommandText = "ElectricityData.LP_Chart_EDIS_Status";
                SqlDataReader sqlread = sqlcomm.ExecuteReader(CommandBehavior.CloseConnection);

                chtLoadProfile.DataBindTable(sqlread, "DateTime");

                sqlcomm.Close();
                sqlread.Close();

All I basicly want is the one column "DateTime" at
the bottum of chart and other colum "Value" at the left.

At the moment it shows some of the data, but also only
shows one bar in the chart

Please any help would be appriciated...
Posted
Updated 10-Feb-12 1:57am
v3

1 solution

What do you want us to say ? You do realise you're calling Clone and not Close on sqlcomm ? I doubt that is your issue, but it jumps out at me.

What do you mean by 'some of the data' ? Have you looked in the debugger, and verified that there's data there that is not showing when it should ? What sort of chart is this ? What have you done to configure it in the way you want it to be ? You need to explain what you've done, what you expect, and why you expect it, and what you see.
 
Share this answer
 

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