If you have a DataTable with that data in it already, this VB.NET code should work:
Dim myData = From d In myDataTable.AsEnumerable() _
Where d.AmountFrom > 2000 AndAlso d.AmountTo < 2000
Select d _
Order By d.DiscountPercent Descending
Note that you have to use the
AsEnumerable
extension method, which is included in the
System.Data.DataSetExtensions
class. You can find out more about this here:
http://stackoverflow.com/questions/10855/linq-query-on-a-datatable[
^]
If you want to use Linq2Sql directly (which I would recommend instead of using ADO.NET to get a DataTable, this article will give you all the help you need:
Using LINQ to SQL in Visual Basic[
^]
Also note that the Where clause is a bit sticky. I wasn't sure what you wanted to do exactly so I got it close. You can further modify it as you need.