Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting my variable to ADO data element
Message
From
03/01/2007 01:18:19
 
 
To
02/01/2007 23:29:07
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
01181662
Message ID:
01181674
Views:
7
>I've been trying to set a variable to a data brought back from a foxpro table.
>
>In VFP it would look something like this:
>
>lcMyVariable = ALLTRIM(customer.firstname)
>
>
>What would be C# version of this statement?

Assuming you have a dataview created, you can do something like this to get the row:
loRow = loDataProvider.oDataView(0).Row
and, then, from any field in that row such as:
lcMyVariable = loRow("FirstName")
If your dataset contains multiple rows, you can scroll to each row like this:
        For lnCounter = 0 To loDataProvider.nCount - 1
            loRow = loDataProvider.oDataSet.Tables("Temp").Rows(lnCounter)
            lcMyVariable = loRow("FirstName")
            ...
        Next
I am using a nCount provider of a data provider class. You may adjust to use the current count of your dataset.

This is VB.NET code but can easily be adapted to C#.
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