Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Newbie question - Strongly Typed DS
Message
De
15/10/2010 11:13:34
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
15/10/2010 09:40:29
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 3.0
Divers
Thread ID:
01485576
Message ID:
01485601
Vues:
58
>Here's a newbie question
>
>I'm using strongly typed dataset I can use intellisense to access the columns nicely as long as I do it in the method that
>creates the dataset, as follows:
>
>
>
>  public DataTable EstablishBlankCustomerData()
>    {
>      meycotestDataSet ds = new meycotestDataSet();
>      ds.arcust.Rows.Clear();
>      ds.arcust.Rows.Add();
>      ds.arcust[0].country = "USA";
>      ds.arcust[0].currency = "USD";
>      ds.arcust[0].nocable = "N";
>      ds.arcust[0].nopump = "N";
>      ds.arcust[0].oringsvssnaps = "N";
>      ds.arcust[0].quomeycolite = "N";
>      ds.arcust[0].quoruggedmesh = "N";
>      ds.arcust[0].quosoliddrain = "N";
>      ds.arcust[0].quosolidpump = "N";  
>      return ds.arcust;     
>    }
>
>
>
>
>I can't figure out how to get intellisense to work when I access the dataset outside that method.
>
>I tried returning the dataset but that doesn't seem to work
>
>Am I missing something?

Bill,
You are returning it as a DataTable. Either return the type of that table or cast it to that type where you need it. ie:
meycotestDataSet.arcustDataTable dt = (meycotestDataSet.arcustDataTable)EstablishBlankCustomerData();

// or
public meycotestDataSet.arcustDataTable EstablishBlankCustomerData()
PS: Instead of Add prefer NewRow. I would prefer using Linq instead.
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