Chart sql

using ZqzWebChart.Charting;
        string strProvider = "Server=.;DataBase=dbname;UID=sa;PWD=sa";
        string mySelectQuery = "SELECT * FROM ProjectStage";
        SqlConnection MyConn = new SqlConnection(strProvider);
        SqlCommand sqlCmd = new SqlCommand(mySelectQuery, MyConn);             
        Chart1.DataSource = sqlCmd;
        Chart1.Series["Series 1"].XValueMember = "StageID";
        Chart1.Series["Series 1"].YValueMembers = "Manhours";
        Chart1.DataBind();

        sqlCmd.Dispose();
        MyConn.Close();

posted @ 2010-05-03 23:53  greencolor  阅读(587)  评论(0编辑  收藏  举报