Was wondering if there is an easy way to bind a dataset to a chart programmatically. Would like to use one of my prebuilt stored procedures without using a strongly typed dataset. Would like to do something like the following. The last line fails however as the chart1 object does not appear to have a datasource property.
SqlConnection connSomsys = new SqlConnection(@"Server=cmdivst004\Jason08;Integrated Security=true;Database=QuoteDB");
SqlCommand selectChartinfo;
selectChartinfo =
new SqlCommand("sprocgetinternationalsales", connSomsys);
selectChartinfo.CommandType =
CommandType.StoredProcedure;
selectChartinfo.Parameters.AddWithValue(
"@year", 2008);
SqlDataAdapter adapter6 = new SqlDataAdapter(selectChartinfo);
DataSet dataSet6 = new DataSet();
adapter6.Fill(dataSet6);
this.chart1.datasource = dataSet6;