Nick LaMarca
Nick LaMarca

Reputation: 8188

Filter Expression Problem On A Datatable

There is something wrong with my filter expression it isnt working. I am simply trying to return the rows that have a CompanyID of mCurrentID. objts is a datatable

Dim mCurrentID As String = lookupInTrenCustomer.EditValue
        'populate grid here
        Dim mFilter As String = "CompanyID=" & mCurrentID
        Dim sortOrder As String = "RegionalBarn DESC"
        objts.Select(mFilter, sortOrder)


        objta.Fill(objts)
        objGridControl.DataSource = objts

Upvotes: 0

Views: 870

Answers (1)

x77
x77

Reputation: 737

If CompanyID is´nt a numeric value, you need enclose it with quotes.

Dim mFilter As String = "CompanyID='" & mCurrentID & "'"

Upvotes: 1

Related Questions