Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using DataViews
Message
De
19/11/2004 18:36:06
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
19/11/2004 16:14:26
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Titre:
Divers
Thread ID:
00963072
Message ID:
00963111
Vues:
8
>I am looking at the code below from the help file (and it is the same as in the example provided with MM) and I can not figure it out. So is it just me, or ...
>
>1. First the code checks to see if DataView named dv+< CurrentTableName > (in this case dvShippers) exists and if not,
>2. goes and creates DataView called dvShippersByPhone
>
>Any reasonable explanation or it is just one of those spelling errors ;)?
>
>// Check if the DataView already exists < ===1.
>DataView dv = (ds.GetDataView("dv" + this.CurrentTableName, this.CurrentTableName));
>if (dv == null)
>{
> // Create a custom DataView sorted by phone
> dv = new DataView(ds.Tables["Shippers"]);
> dv.Sort = "Phone";
> ds.AddDataView(dv, "dvShippersByPhone"); < === 2.
> }

Probably reasoning is this:
If there is already a DataView name starting with 'dvShippers' it assumes user created a dv as s/he wanted. If it doesn't find one then creates a view sorted by phone and names it adding sort column name.
PS: Just guessing. I don't know what GetDataView method does.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform