Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 12th, 2004, 02:11 PM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default Basic DataGrid select column Question.

Hello
A very basic ques about datagrid.

I pulled from SQL a 10 column data into dataset.
I only need to display 3 columns in datagrid.

I couldn't get this to work with dataview because you can only do rowfilter not column filter.

Then I tried to use PropertyBuilder of DataGrid to assign bound columns with data field of dataset.
When I created 3 columns of the 10 column dataset explicitly, why do the other 7 columns still load in datagrid. Is there a way for the datagrid not to load the other 7 columns?

The only way i got this to work to have stored procedure only pull 3 columns into dataset and use the entire dataset. But I don't want to do this cuz then I need more than 1 dataset.

All suggestions are welcome.

 
Old August 12th, 2004, 02:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Check to see if AutoGenerateColumns is set to false
or
Try:

SELECT column_1, column_2, column_3 FROM table_name

 
Old August 12th, 2004, 07:11 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Yes, AutoGenerateColumns is probably set to true; you can tell because it would load the original 10 and additional 3. If it is doing this, that's your problem. That's the only thing I know that would generate the 10, because if it is set to false, you have to manually add the columns.

Brian
 
Old August 12th, 2004, 10:36 PM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Got it Thanks






Similar Threads
Thread Thread Starter Forum Replies Last Post
Please HELP Very Basic Question jkoe578 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 November 18th, 2006 10:06 AM
to different result column basic on some condition designwork SQL Language 1 December 21st, 2005 11:27 AM
Select a Column of DataGrid thomaz C# 0 June 29th, 2005 01:59 PM
Select Into Statement I think, Basic question gmoney060 SQL Server 2000 4 December 31st, 2004 02:52 AM
basic question but..... Adam H-W Javascript How-To 2 February 10th, 2004 01:24 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.