Saturday, 15 August 2015

c# - How to load a DataGridView correctly while updated happening -



c# - How to load a DataGridView correctly while updated happening -

i implemented datagridview time ago. works nice. doing heavy-load testing, failed. throws exceptions everywhere, @ to the lowest degree when tries load data.

problem: datacontext refresh

there method refresh the info within datagridview.

one exception tells me there datareader open, have close first.

the sec exception tells me "the operation cannot performed during phone call submitchanges".

the problem not working datareaders myself, using approach see below:

this.bindingsource.endedit(); this.bindingsource.datasource = null; // datacontrol controler table stored. singleton. datacontrol.instance.m_dbtable.context.refresh(system.data.linq.refreshmode.overwritecurrentvalues, datacontrol.instance.m_dbtable); this.bindingsource.resetbindings(false); this.bindingsource.datasource = datacontrol.instance.m_dbtable;

i hope can help me on one. sense free inquire more details if needed.

thanks

more exceptions thrown (not on method, on same form.)

internal connection fatal error sql datetime-overflow (must between 1/1/1753 , 21/31/9999) (i initialize date-time variables!) invalid reading operation when there no info available. no reference exception.

any time getting errors relating wrap datareader in using statement. goes reader / writer

using(var darareader = new datareader()) { // utilize info reader here, not left open }

c# winforms .net-3.5

No comments:

Post a Comment