Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting my variable to ADO data element
Message
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
01181662
Message ID:
01181857
Views:
7
>Hello.
>
>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?

What type of object is your data in? Is it in a datatable or dataset, or other object?

For the dt or ds
ds:
string myCust = ds.Tables["Mytable"].Rows[0]["firstname"].ToString()

dt:
string myCust = dt.Rows[0]["firstname"].ToString()

I have only one row in my data row 0. You may need to filter through a data table to find the row your looking for, and substitute the 0 with the var for that int value.

int rNumber = 9
string myCust = dt.Rows[rNumber]["firstname"].ToString()

Clear as mud right?
Previous
Reply
Map
View

Click here to load this message in the networking platform