G
Guest
This is for a Win form.
Before I made changes to my text boxes this code worked. I don't think I
touch any code relating to my datagrid. Code should populate my datagrid
with blank data, this use to work but now I get a
"System.OutofMemoryException", on the DataRow dr = dt.NewRow();
DataTable dt = dgPrivileges.DataSource as DataTable;
DataRow dr = dt.NewRow();
dr[0] = 0;
dr[1] = 0;
dr[2] = 0;
dr[3] = 0;
dr[4] = 0;
dr[5] = 0;
dr[6] = 0;
dt.Rows.Add(dr);
dt.Clear();
I also tried deleting the datagrid (dgPrivileges) and created a new datagrid
and named it dgPrivileges, but that didn't change anything.
Before I made changes to my text boxes this code worked. I don't think I
touch any code relating to my datagrid. Code should populate my datagrid
with blank data, this use to work but now I get a
"System.OutofMemoryException", on the DataRow dr = dt.NewRow();
DataTable dt = dgPrivileges.DataSource as DataTable;
DataRow dr = dt.NewRow();
dr[0] = 0;
dr[1] = 0;
dr[2] = 0;
dr[3] = 0;
dr[4] = 0;
dr[5] = 0;
dr[6] = 0;
dt.Rows.Add(dr);
dt.Clear();
I also tried deleting the datagrid (dgPrivileges) and created a new datagrid
and named it dgPrivileges, but that didn't change anything.