J
John Dann
Is there a concise/efficient way to retrieve blocks of rows from a
datatable with VB2005?
I've got a datatable (let's call it AllData), constructed
programmatically, that contains a lot of sequential scientific data,
each row being a point in a time-course potentially every minute and
with data maybe extending over many months. There's a column
(Date_Time) set as a primary key which contains a datetime stamp (as a
datetime type) for each row.
What I'd like to do is to query the datatable for all rows relating to
say a single day by coding something like (I know this isn't legal
VB):
Dim DailyData as datatable = AllData.Select(col("Date_Time") where
datetime > start-time AND datetime < end-time)
I could obviously do something by iterating 'manually' over all the
rows in AllData, but I was hoping to find a simpler and maybe more
efficient approach. AllData is just an in-memory datatable so AIUI I
can't use a standard SQL query on the datatable as I could if it were
a database. And I'm stuck with VB2005 so I don't believe that I could
use LINQ, which might make this easy in eg VB2008. So are there any
other options please?
datatable with VB2005?
I've got a datatable (let's call it AllData), constructed
programmatically, that contains a lot of sequential scientific data,
each row being a point in a time-course potentially every minute and
with data maybe extending over many months. There's a column
(Date_Time) set as a primary key which contains a datetime stamp (as a
datetime type) for each row.
What I'd like to do is to query the datatable for all rows relating to
say a single day by coding something like (I know this isn't legal
VB):
Dim DailyData as datatable = AllData.Select(col("Date_Time") where
datetime > start-time AND datetime < end-time)
I could obviously do something by iterating 'manually' over all the
rows in AllData, but I was hoping to find a simpler and maybe more
efficient approach. AllData is just an in-memory datatable so AIUI I
can't use a standard SQL query on the datatable as I could if it were
a database. And I'm stuck with VB2005 so I don't believe that I could
use LINQ, which might make this easy in eg VB2008. So are there any
other options please?