Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Lookup from a view
Message
From
13/01/2005 15:14:30
 
 
General information
Forum:
ASP.NET
Category:
Databases
Miscellaneous
Thread ID:
00976908
Message ID:
00976911
Views:
22
>If you're asking what I think you're asking (searching an ADO.NET datatable for something)...
>
>If you've defined a primary key, you can perform an ADO.NET FIND, which is (more or less) the equivalent of a SEEK.
>
>If you need to do something beyond that, you can perform a ROWFILTER to create a view/get a collection of rows that match a condition.
>
>Let me know if that helps...if it doesn't, if you can be a little more specific as to what types of lookups you want to do, maybe we can go from there.

At this point, I am scanning the entire view until I find the proper strings:
        Dim lnCounter As Integer
        Dim lcString As String
        Dim lcKey As String
        Dim lcModule As String
        lcString = tcKey
        lcKey = UCase(tcKey).PadRight(25, " ")
        lcModule = UCase(tcModule).PadRight(20, " ")
        For lnCounter = 0 To oData.Count - 1 Step lnCounter + 1
            If oData(lnCounter).Row("Key") = lcKey And oData(lnCounter).Row("Module") = lcModule Then
                If tnLanguage = 1 Then
                    lcString = oData(lnCounter).Row("French")
                Else
                    lcString = oData(lnCounter).Row("English")
                End If
                Exit For
            End If
        Next
        Return lcString
Despite that this approach is much faster than all those requests I was making to the data adapter before, as I only do one now to return all the rows into a view, I still would like to optimize it more such as you said.

Can you provide an example of using the lcKey and lcModule to locate the record I need?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform