for (int i = 0; i <= dataGridView1.Rows.Count; i )
{
string point_value = dataGridView1.Rows[i].Cells[1].Value "|";
}
有誰知道我為什么會收到這個錯誤
無效的運算式術語“ =”
這段代碼?
uj5u.com熱心網友回復:
您在 for 回圈中創建新變數的原因
如果您需要在每個回圈中存盤資料,您應該在回圈外創建變數
像這樣
string point_value = "";
for(int i=0; i < dataGridView1.Rows.Count; i )
{
point_value = dataGridView1.Rows[i].Cells[1].Value "|";
}
有關回圈模式的更多資訊,請點擊此處
(編輯以避免空值和超出 DiplomacyNotWar 評論的范圍)
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/457468.html
標籤:C#
