Using DataList to display DB records

rangerstud620

Freshman
Joined
Jun 14, 2005
Messages
27
I'm tackling a rather advanced project and I'm looking for some ideas to get started. :eek:

I've got a DB table that contains customer info. Each customer could have multiple records in the table that are linked by the field, "SCode." Basically I need to group all records for each customer and then display them. The display would look something like this:
Code:
Customer 1              Customer 2             Customer 3
address....phone        address....phone       address....phone
address....phone                               address....phone
address....phone

Each customer's info will need to be edited, but right now I'm just looking at getting everything displayed correctly. So first off, is it possible to display records this way? I was thinking a DataList might work? If it is possible, how would I go about getting it setup? Any help or ideas would be awesome!!!
 
I would actually use multiple controls. Set up your data in a DataSet with a Customers DataTable and Address DataTable and a Data Relation between them.

Then I'd use a DataList for the Customers Information, and Nest either a DataGrid or another DataList in the ItemTemplate for the Address informaiton. The DataSource for the nested table would be based on the DataRelation between the two datatables.

This article has some sample code and a pretty detailed description of using the DataGrid. You'll just have to apply the same techniques to a DataList.
 
Thanks for the idea wayneph. I will take a look at that and see what I can come up with. I haven't done anything like this yet so we'll see how it goes :p. If anyone has any other ideas, I'm certainly open to them. Thanks for the help!!!
 
Back
Top