المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : DataTable row column lookup possiblity?



C# Programming
06-01-2010, 08:20 PM
I'm trying to determine if its possible to get the row index of the data combination while avoiding the interation for-loop?

Here's an example below

DataTable may look like this (with variable named "datTab":

Name Number1 Number2 Number3 Number4
Ron 60 43 33 40
Sco 83 43 33 42
Alb 60 43 32 40
Hei 34 32 45 55
Ant 23 43 33 23


Now, the question is... is it possible to get the row index number if I would find the number combination with 4 numbers? Such as I would say to find 60, 43, 33, 42 and it would find the row index = 1. I understand it can do for one column, such as

int indexTab = datTab.Rows["Number1"].IndexOf("00");

but with multiple columns? I just thought of it as I use it in my code and the software is really sluggish with muliple columns using For-loop and if-statement inside the loop.

I hope someone can answer this. I'm hoping this will provide better performance.

Thanks!