[問題] [c#]請問若從sql server撈資料並以此繪圖

看板Programming作者 (珍 惜)時間11年前 (2014/05/20 17:07), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
想產生的是類似progressba的橫式進度圖 該選用甚麼控制項呢 小弟ˇ目前選用chart 但是databind不出來 不知該怎麼寫 以下附上程式碼 DataSet dataset = new DataSet(); string strSQL = "SELECT (SELECT COUNT(*) FROM ProjSubTasks PSJ JOIN PROJTASKS PJ ON PJ.TASKID=PSJ.TASKID WHERE PJ.TASKID=1 )as total, (select count(TaskClosed) from projsubtasks where taskclosed=1) as closed FROM ProjSubTasks group by taskid"; GetData(strSQL, "ProjSubTasks"); chart1.DataSource = dataset.Tables["ProjSubTasks"]; chart1.DataBind(); private void GetData(string commandstring, string tablename) { string connectionstring = @"****************************" SqlConnection connection = new SqlConnection(connectionstring); SqlCommand command = new SqlCommand(commandstring, connection); DataTable table = new DataTable(); SqlDataAdapter adapter = new SqlDataAdapter(command); adapter.Fill(dataset, tablename); } -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 125.227.255.79 ※ 文章網址: http://www.ptt.cc/bbs/Programming/M.1400576827.A.FD1.html
文章代碼(AID): #1JUnix_H (Programming)
文章代碼(AID): #1JUnix_H (Programming)