Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reading a .NET Dataset returned from a call
Message
 
À
11/05/2007 13:29:52
John Baird
Coatesville, Pennsylvanie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Jet/Access Engine
Divers
Thread ID:
01224719
Message ID:
01224878
Vues:
11
>>
>>I tried things like DS.id and ds.id(1) and all I get are errors saying "member not found". I also tried x = xmltocursor(ds). VFP was not happy.
>
>
>ADO is a colleciton of objects. DataSet contains tables which contains columns and rows:
>
>
>MyDataSet.Tables[0] is the first table;
>MyDataSet.Tables[0].Columns[0] .. [end] shows the defined columns.
>MyDataSet.Tables[0].Rows[0] .. [end] shows the defined rows.
>
>So you can get the field values for your data by saying: mydataSet.Tables[0].Rows["mycolumn"] (which is an object that has to be converted to display the correct type):
>
>
>string - mydataSet.Tables[0].Rows["mycolumn"].ToString()
>int - Convert.ToInt32(mydataSet.Tables[0].Rows["mycolumn"])
>
>etc. Hope this helps.

Hi guys,
thanks very much for the all your help. With your suggestions and help from the guys that produce .net extender I was able to solve it with this code.
(The ? is just to print the test out on the screen as records.)
oEmployee = CLRCreateObject("PenSoftx.Employee",1)
ds = oEmployee.GetEmployees
oTable = ds.Tables.item(0)

For nRow = 0 to oTable.Rows.Count -1
  ?
  oRow = ds.Tables.item(0).Rows.Item(nRow)
  FOR nCol = 0 to oTable.Columns.Count -1
    eData = oRow.Item(nCol)  && Data in each column in a Row (record)
    ?? eData
    ?? ', '
  ENDFOR
ENDFOR
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform