Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TableAdapter to return only selected columns.
Message
From
30/03/2009 13:06:27
 
 
To
30/03/2009 11:19:04
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
01392118
Message ID:
01392152
Views:
48
My 2 cents is don't use TableAdapters. They are, more or less, a dumbed-down wrapper around the DataAdapter, IMHO.

The designer automatically sticks them in the DataSet class and in the .xsd. So also IMHO, a DataSet should not know anything about where it gets its data, and this TableAdapter stuff totally tightly couples a DataSet with the backend DataSet. Bad, Bad, Bad. Sorry. =0(

~~Bonnie



>(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.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform