我正在尝试显示 asp.net 图表。我写了以下代码
public SqlDataAdapter da;
DataSet ds1;
public DataSet SelectDayWiseEnquiriesForCChart()
{
int orgid;
orgid = ((int)Session["orgid"]);
DbConnect objdbc = new DbConnect();
SqlConnection con = objdbc.openConnection();
da = new SqlDataAdapter("SELECT EnquiryOwner,Count(uid) from EnquiryMaster WHERE orgid='" + orgid + "' and ( DAY(date) = DAY(GETDATE()) AND MONTH(date) = MONTH(GETDATE()) AND YEAR(date) = YEAR(GETDATE()) ) group by EnquiryOwner", con);
ds1 = new DataSet();
da.Fill(ds1);
return ds1;
}
protected void FillChartControl()
{
Chart1.DataSource = SelectDayWiseEnquiriesForCChart();
Chart1.DataBind();
}
<asp:Chart ID="Chart1" runat="server">
<series>
<asp:Series Name="Series1" XValueMember="EnquiryOwner" YValueMembers="uid">
</asp:Series>
</series>
<chartareas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</chartareas>
</asp:Chart>
我收到一个名为 uid not found 的错误列,我无法理解为什么会出现此错误。