C
C#2mo ago
Midas

✅ System.IndexOutOfRangeException

I tried to insert some rows from my Database and when I run and check in the Form it tells me this: "System.IndexOutOfRangeException" here is the part where the error is present: dataGridView1.Rows.Add(reader["customer_name"].ToString(), reader["order_date"].ToString(), reader["total_amount"].ToString(), reader["product_name"].ToString());
2 Replies
prince
prince2mo ago
hello i recommend storing into variables before putting into the add function string customer name = reader.... @midas
Midas
Midas2mo ago
thanks, but I found how to solve the problem so far