8
Answers

Search value with datatable select in specific row range

Nebula

Nebula

5y
19.3k
1
Hi, I am trying to get value from specific row range.
 
This is the code i tried but not sure where should i use the variable rows.
  1. var rows = dt.AsEnumerable().Skip(0).Take(15);  
  2. string value = "CB123";  
  3. DataRow[] result = dt.Select("BOOKCODE like '%" + value + "%'");  
  4. //foreach (var col in rows)  
  5. //{  
  6. if (result.Count() > 0)  
  7. {  
  8.     MessageBox.Show("BookCode Not Found");  
  9.     //Application.Exit();  
  10. }  
  11. //}  
Answers (8)