Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Mom and Pop
Message
De
23/01/2004 18:58:37
 
 
À
23/01/2004 16:44:00
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrats & ententes
Titre:
Divers
Thread ID:
00868956
Message ID:
00870181
Vues:
26
Walter,

First, I don't see OO and relational as mutually exclusive.

Second, with a bit of creativity, one can fairly easily write generic functions in C# (or VB.NET), using existing ADO.NET capabilities, to do something similar to what you're describing.

As an example, while there's an equivalent to SEEK (just define a primary key for a data table and then do an ADO.NET FIND) and there's an equivalent to FILTER and SORT, there isn't a LOCATE (at least not that I'm aware)...however, one can do something like this (I'm typing this as an example)...

DataRow DrLookup = LocateRow("Kevin","FirstName",dtEmployees);
if(DrLookup!=null)
// found
else
// not found


private DataRow LocateRow(string cText,string cColumnName,DataTable dtSearch)
{
DataRow DrReturn =null;
for(int iRowCtr=0;iRowCtr if(dtSearch.Rows[iRowCtr][cColumnName].ToString()==cText)
{
DrReturn = dtSearch.Rows[iRowCtr];
break;
}
return DrReturn;
}


Now, this is still pretty basic, but you could extend this, like adding an optional parameter for where to start, whether to do an exact match or a substring search, etc.

Bottom line is that one can put together a set of functions in ADO.NET to handle the type of data munging that we've all done in VFP for years.

Kevin
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform