Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TableAdapter to return only selected columns.
Message
De
30/03/2009 12:40:23
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
30/03/2009 11:19:04
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
01392118
Message ID:
01392149
Vues:
48
>(VS2008) I'm trying to configure a TableAdapter in a Typed DataSet to return only a certain subset of columns from the main schema of the table on which it is based, but it always returns the entire schema (all columns) with blank values in the columns I have omitted.
>
>The TableAdpater has the default Fill and GetData() methods that come from the wizard, which contain every column in the table, which is fine. I then added a new parameterized query method called GetActiveJobsByCustNo(CustNo), and I only included a few columns in the SQL query that I actually want to be in this table view.
>
>But, again, it returns all the columns in the master table schema, with empty values for the columns I omitted.
>
>The reason I am wanting this, is so I can just get a few columns back to use that table view with AutoGenerateColumns in an ASP.NET GridView. With it giving me back EVERY column i nthe schema, my presentation GridView contains way more columns that I want to show th user. And, I want to avoid have to declare the columns in the GridView.

Matt,
IMHO with an updatable table it is best to get all columns anyway. AutoGenerateColumns = false and setting column templates in code looks like a better way to me.
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