Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

AcceptChanges long time GetChanges is nullptr

$
0
0
A previous question I had about saving NULL in sql db led me to abandon DataAdapters, Bindings, etc and use only DataTable, sql commands and TextBoxes. Towards the end with it working properly, I started to look at performance (table has around 3500 rows), and was annoyed at how long it took right after a DataTable->Load to AcceptChances after modifying the db from interpreting the TexrBox->Text, reading from the db to get an array to modify the DataTable, doing a T0->LoadDataRow(aDR, true), and finally to do a T0->AcceptChanges. The longest step by far was the T0->AcceptChanges() at around 4000ms where all the rest took less than 20 ms. I did not think there should be any pending changes with the LoadDataRow AcceptChanges=true. It all took about the same time. The LoadDataRow  with true AcceptChanges was about 5 ms and the T0->AcceptChanges around 4 to 5 seconds. Then I created a function:
private: void T0_AcceptChanges() {
	STW->Reset();
	T0x = T0->GetChanges();
	if (T0x != nullptr)	T0->AcceptChanges();
	allms[5] = STW->ElapsedMilliseconds;
	tbxT0MSG->Text = "T0_AcceptChanges Elapsed = " + allms[5].ToString();
and found T0x was a nullptr. Now the time was cut to less than a ms. Would anyone else have such experience and or explanation?

Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>