C
C#4mo ago
Midasik

✅ 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
prince4mo ago
hello i recommend storing into variables before putting into the add function string customer name = reader.... @midas
Midasik
Midasik4mo ago
thanks, but I found how to solve the problem so far