0
public partial class Piechart : System.Web.UI.Page
{
private decimal total = 0; // course total
private decimal registered = 0;
private decimal regAttend = 0;
private decimal nRegAttend = 0;
private int regPer = 0;
private int regToTotalPer = 0;
private int nRegPer = 0;
private int angle = 0;
private int angle2 = 0;
private int angle3 = 0;
private int parTotal = 0;
//const string G = "SELECT DISTINCT COUNT(Grouping) from Attendance";
// SqlConnection c = new SqlConnection(@"Data Source=localhost\SQLEXPRESS;Initial Catalog=PSeminar;Integrated Security=true;Trusted_Connection=Yes;MultipleActiveResultSets=true");
//SqlCommand Command = new SqlCommand(G);
private string[] Status = new string[2] { "Attend", "Didn't Attend" };
private string[] Course = new string[] {//items from database};
我想使用一個sql語句來調用項目列表並存儲在上述數組中。我這樣做是因爲之前數組中的項目是硬編碼的。現在我想從數據庫中檢索它,因爲每當有新項目時,都會自動繪製一個新的餅圖。如何在數組中存儲數據庫中的項目?
哪些** **項目要存儲到一個數組數據庫來做到這一點? – adatapost
你的問題是什麼? – Icarus
爲什麼將它存儲在一個數組中,只是將它存儲爲List <>並捕獲數據行 – CBRRacer