1
我正在使用coulmn圖表,其中我想要綁定coulmn的表與系列的
點。我知道points.databind()方法。但它首先採取什麼類型的對象 參數?? ?綁定數據與圖表的點
的.aspx代碼:
<asp:Chart ID="Chart1" runat="server">
<Series>
<asp:Series Name="Series1">
</Points>
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
代碼背後:
protected void Page_Load(object sender, EventArgs e)
{
assessdal d=new assessdal();
Chart1.DataSource = d.showop1();
Chart1.DataBind();
Chart1.Series[0].Points.DataBind(?,"qno");
}
public DataSet showop1()
{
SqlConnection con = dbconnect.GetConnection();
SqlCommand cmd = new SqlCommand("select assessid, qno ,description,
option1,option2,option3,option4 from assessmenttest", con);
SqlDataAdapter ad =new SqlDataAdapter(cmd);
DataSet ds=new DataSet();
ad.Fill(ds);
return ds;
}