Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting my variable to ADO data element
Message
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
01181662
Message ID:
01181857
Vues:
8
>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?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform