我已經有一個SQlite數據庫設置。現在我正在解析它。例如,如果Seq列中的某些值大於30,我將這些值轉移到列表中。 我想使用該列表,來填充數據網格視圖,以便用戶可以看到哪些值均> 30如何使用列表值作爲c中的單獨列填充數據網格#
如何填充多個列表數據網格視圖?基本上列1應該是列表1,列2,列表2等。
編輯:有沒有人認爲我應該使用列表視圖呢?如果是這樣,怎麼樣?
這裏是我的解析代碼來獲取我的列表的值。現在我需要以某種方式填充這些列表中的DGV。
string sql4 = "select * from abc";
SQLiteCommand command = new SQLiteCommand(sql4, sqlite_conn);
// The datareader allows us to read the table abc row by row
SQLiteDataReader reader = command.ExecuteReader();
// What happens next: We are trying to parse each column for irregularities to show to the user. For example if a value in column
// Seq is >30, we need to let the user know. We do this by adding all values >30 to the SeqIrregularities list.
while (reader.Read())
{
int seq;
if (int.TryParse(reader["Seq"].ToString(), out seq))
if (seq > 30)
{
SeqIrregularities.Add(seq);
seq1 = true;
}
int maxlen;
if (int.TryParse(reader["MaxLen"].ToString(), out maxlen))
if (maxlen> 30.00)
{
MaxLen.Add(maxlen);
maxlen1 = true;
}
}
我怎麼會真的這樣做 – Newuser
不要有這檯筆記本電腦的Visual Studio,但這樣的事情是快速和骯髒的方式。 – Cortright