.net - Datatable.Select gives wrong results depending on focus of Datagridview -


i'm using select on datatable , getting unexplainable results. using visual studio 2013 , vb.net.

i have dataset datasource of datagridview. dataset has column contains boolean values, represented checkbox datagridview. i'm using solution jsturtevand in thread make sure dgv updated after user moves mouse away checkbox. each time user changes checkbox value, corresponding row updated in database.

in form user can click on apply , bunch of actions executed depending on checkboxes checked. code use find selected items is:

 dim rows() datarow  rows = dsfiles.tables(0).select("isactive = true") 

when user selects checkboxes, action changes focus , presses apply, correct results. if user changes checkbox , presses apply select statement won't find last change. if has 2 items selected, selects third , presses apply, select statement finds 2 items. here weird part: if check dataset before executing select, contains correct data , if use loop this

    each row datarow in dsfiles.tables(0).rows         if row("isactive") = true count += 1     next 

then correct number of items. means .select returns different data when same thing supposed hand. , how of related user pressing apply before leaving focus when dgv, database , dataset updated correctly? works fine, , yet .select doesn't work. of course use loop, want know how possible.

edit: wrongly assumed .select linq method. removed references linq.


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -