c# - How do I compare data in a List to Data in a DataView? -


i have dataview containing data, need compare dataview list<string> , data list<string> not in dataview. list populated using listbox.

here list:

    //populate list<string> listbox     private void loadlist()     {         var vehicle = new list<string>();         var model = new list<string>();           foreach (listitem automobile in listbox1.items)         {             var components = automobile.value.split('\\');              vehicle.add(components.first());              model.add(components.last());         }          (var = 0; < vehicle.count; i++)         {             // compare items in list<string> dataview             // data list not in dataview         }      } 

this listbox , list<string> before , after.

enter image description here

the dataview data structure:

the vehicle , model both primary key (composite).

enter image description here

*this dataview member:

    private static dataview localdataview { get; set; } 

how compare list against dataview , vehicle , model list not exists in dataview?

you can use except

list.except(localdataview.select(x => string.form("{0} {1}" , x.vehicle, x.model).tolist()); 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -