I have a sqlce database table that I am entering data every day.
Date No Meter_1 Meter_2 Meter_3
12-05-2010 1 1234 3456 4567
12-05-2010 2 3423 4567 0987
13-05-2010 1开发者_如何学JAVA 2345 7654 7654
13-05-2010 2 7676 8765 5643
14-05-2010 1 2345 7654 7654
14-05-2010 2 7676 8765 5643
15-05-2010 1 2345 7654 7654
15-05-2010 2 7676 8765 5643
and I would like to find difference between given 2 dates with datetimepicker and display them in datagrid. Example: If I select Dates between 15th and 12th. Function has to subtract 12th meter values from 15th meter values. It was easy when i was dealing in Access with queries. But I can't do in VB.net. Any help will be highly appreciated.
Thanks to every one
You can write queries against SQLCe so you could continue doing it that way. Otherwise, you can use SqlCeDataReader to retrieve all the data you need from the database (for example any records from the 12th and 15th), cache them in some list or something if needed for easier processing, process the data as needed (subtracting etc) then just add the data in the list to your grid.
See here for a sample of using SqlCeDataReader.
精彩评论