Akhil
Akhil

Reputation: 471

datatable select method for datetime on date filter

I have a datatable "dt" with a column "

datetime"(format 'dd/MM/yyyy hh:mm:ss AM/PM')

i need to retrieve the set of rows such that

dt.select("datetime='"& dateString &"'").rows

where "dateString" has a date format "dd/MM/yyyy"

Upvotes: 0

Views: 1552

Answers (1)

sathish
sathish

Reputation: 71

Using Linq

dt = dt.AsEnumerable.Where(Function(x) x.Field(Of String)("datetime").Substring(0, 9) = datestring).CopyToDataTable

Upvotes: 2

Related Questions