Hello:
After adding some data to a table by pasting from excel, my program can now no longer read the range of the datagridview.
The error is
System.ArgumentOutOfRangeException:
'Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index'
I have tried many things including deleting the tables and re-adding to the project (edmx), as well as refreshing from the database. I even created a new project to attempt starting over, as well as deleted and re-added the datagridviews to the form.
Please let me know what I am not doing that needs to be done.
After adding some data to a table by pasting from excel, my program can now no longer read the range of the datagridview.
The error is
System.ArgumentOutOfRangeException:
'Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index'
C#:
[SIZE=2]The code is here:
[FONT=Consolas][SIZE=2][COLOR=#008000]
[FONT=Consolas][SIZE=2][COLOR=#008000]
[FONT=Consolas][SIZE=2][COLOR=#008000]
// Set Row 1 of dgvJobDetail
[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [COLOR=#FF0000]dgvJobDetail.CurrentCell = dgvJobDetail.Rows[0].Cells[0];[/COLOR]
dgvJobDetail.Rows[0].Selected =
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2];[/SIZE][/FONT][/SIZE][/FONT]
[FONT=Consolas][SIZE=2]
[FONT=Consolas][SIZE=2]
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]var[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] args2 = [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] DataGridViewCellEventArgs(0, 0);[/SIZE][/FONT][/SIZE][/FONT]
[FONT=Consolas][SIZE=2]
[FONT=Consolas][SIZE=2]
dgvJobDetail_CellClick(dgvJobDetail, args2);
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].Refresh();[/SIZE][/FONT][/SIZE][/FONT]
[/SIZE]
I have tried many things including deleting the tables and re-adding to the project (edmx), as well as refreshing from the database. I even created a new project to attempt starting over, as well as deleted and re-added the datagridviews to the form.
Please let me know what I am not doing that needs to be done.