Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 November 17th, 2003, 08:29 AM
Authorized User
 
Join Date: Sep 2003
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Default Datagrid column values

Hi everyone,

Can someone tellme how I can iterate through all the values of a column in a databse?

Thanks,

Pankaj

 
Old November 17th, 2003, 10:59 AM
Authorized User
 
Join Date: Jul 2003
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

you can use a 'for next' loop to run through each row in your dataset

 
Old November 17th, 2003, 11:28 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

If you want to show these values in a DataGrid, you just need to bind the results you got from the database to the datagrid. Usually it's something like this:

'Do database stuff here...
DataGrid1.DataSource = dataSet1.Tables(0)
DataGrid1.DataBind()

That's it. Now your datagrid will show every column and every row in the resulting datatable. You can use the DataGrid markup to customize the datagrid (hide columns, change styles, etc)

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old November 17th, 2003, 05:04 PM
Authorized User
 
Join Date: Sep 2003
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi everyone,

I made a mistake in posting my question. The question that was intended was: how to iterate through the values of a column of a DATAGRID. Sorry about that.

Thanks,
Pankaj

 
Old November 17th, 2003, 05:51 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

I don't understand your question. If I understand correctlty the datagrid control is what the code gets returned to. You can create a data source and have it bound to the datagrid control.

Are you wanting to know about data paging? IE. [u]< Prev. Page</u> | Page 2 of 5 | [u]Next Page ></u>






Similar Threads
Thread Thread Starter Forum Replies Last Post
Modifying column values BabyToy BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 June 18th, 2007 10:15 PM
summing column values hydriswall PHP Databases 1 December 8th, 2006 04:54 AM
Get random column values? seismik SQL Server 2005 3 November 21st, 2006 06:02 PM
Datagrid column values krishnasamaga C# 2005 1 August 8th, 2006 06:54 AM
TSQL to get column values mstuart60 SQL Language 2 June 9th, 2003 04:15 PM





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