ShowUsYour<Blog>

Irregular expressions regularly

Compute is not a cultured method

Even though, in the constructor for my WinForms app I do this...

    Thread.CurrentThread.CurrentCulture = New CultureInfo("en-AU")

I'm finding that the MIN, MAX functions for DataTable querying seem to use en-US under-the-covers...

    ' cannot use ADO.NET syntax
    mdtmMinDate = Convert.ToDateTime(mobjTimeSheetGrid.Compute("MIN(TimesheetDate)", ""))
    mdtmMaxDate = Convert.ToDateTime(mobjTimeSheetGrid.Compute("MAX(TimesheetDate)", ""))

So, I had to roll my own :(

    ' cannot use ADO.NET syntax
    mdtmMinDate = Convert.ToDateTime(mobjTimeSheetGrid.Compute("MIN(TimesheetDate)", ""))
    mdtmMaxDate = Convert.ToDateTime(mobjTimeSheetGrid.Compute("MAX(TimesheetDate)", ""))
    For Each row As TimeSheet.TimeSheetRow In vobjTimesheetGrid.Rows 
        Dim tmpDate As String = row.TimesheetDate 
        If CDate(tmpDate).CompareTo(mdtmMinDate) = -1 Then 
            mdtmMinDate = CDate(tmpDate) 
        End If 
        If CDate(tmpDate).CompareTo(mdtmMaxDate) = 1 Then 
            mdtmMaxDate = CDate(tmpDate) 
        End If 
    Next

Further information about Compute method:

DataTable.Compute - the filter parameter
Compute - MS docs

Comments

Sabine said:

Badly need your help. I'm moving, but don't worry! [Someone once] told me we're all on the same planet, so I'll be okay! Help me! Can not find sites on the: Airbrush tanning wimberley tx. I found only this - <a href="www.clubespanolrosario.org.ar/.../AirbrushTanning">airbrush tanning supply in milwaukee</a>. After tanning, why darkens your information know? Use your cottage product without tanning under the stress! Thank :confused: Sabine from Lanka.

# March 24, 2010 12:23 PM

Lenda said:

Hello. Hey Garrett, the new record sounds great I'm gonna try and make it to the next show around here, You cats are outta sight. Help me! Help to find sites on the: Phenergan itch opiates. I found only this - <a href="ler.itcilo.org/.../phenergan-tablet-picture">phenergan tablet picture</a>. Yes symptoms, 8 hours in a food, phenergan. Phenergan, as reactions of parkinson's floor also defraud over the children, eczema can flip going less high and recreational. Waiting for a reply :rolleyes:, Lenda from Mali.

# March 30, 2010 12:54 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)