Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 11th, 2007, 11:22 PM
Friend of Wrox
 
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default custome display in grid view

i have table having three columns state,city and address

a state have multiple cities and there are many records for one city.

i fetch all the data from database by datareader. or when i get city i get all records for that city in dataset.

my main trouble is how to display data in required form. i want to display data in following form:

State1 (one time)

City1 (one time)

Address1

Address2

Address3

City 2

Address1

Address2

Address3

Please help me.



thanks......
__________________
thanks......
  #2 (permalink)  
Old November 12th, 2007, 12:54 AM
Authorized User
 
Join Date: Jan 2007
Location: Islamabad, Punjab, Pakistan.
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aliirfan84
Default

Dear,
    You have to make parent child relationship in dataset. First you have to get each tables data from Database into new table and then add this table to common dataset.
    DataSet has methods as shown below:

     dsObject.Relations.Add("relationName",dsObject.Tab les("table1").Columns("colName"),dsObject.Tables(" table2").Columns("colName")

This will create Parent-Child relationship.

Now in ur .aspx, take databinding control of ur choice(Grid,Repeater,DataList). Put another data control inside another. For example, if u take GridView then add another girdview/reapter control in using template column.

In ur .cs/.vb file, set dataSource property of parent databinding control to .dsObject. U just need to set child control datasource property to dsObject.CreatChilView("relationName").

Hope it will help.

Regards


Regards,
Ali Irfan
Software Engineer
  #3 (permalink)  
Old November 12th, 2007, 01:49 AM
Friend of Wrox
 
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

my all data is present in one table.
are you saying that i should issue three queries and store it in three tables. No.
am i confuse
can you explain it in littele more from syntax point of view.
i will be extremely thankful to you.


thanks......
  #4 (permalink)  
Old November 14th, 2007, 10:11 PM
Friend of Wrox
 
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

well i solve this problem by taking a table control in aspx page and creating table rows and cells in code file and put controls and text into that.


thanks......
  #5 (permalink)  
Old November 16th, 2007, 09:13 AM
Authorized User
 
Join Date: Jan 2007
Location: Islamabad, Punjab, Pakistan.
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aliirfan84
Default

Yes dear, You have to made three SQL queries and then store in same dataset.
Rest is as I mentioned in last post. Sorry for late reply.



Regards,
Ali Irfan
  #6 (permalink)  
Old November 16th, 2007, 11:45 PM
Friend of Wrox
 
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

yes, i solved it thanks for all help.

thanks......
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Grid view roopeshmkatlive.in ASP.NET 1.0 and 1.1 Professional 1 August 1st, 2008 01:03 PM
Help Grid View Drop Down List, view all jskinner123 ASP.NET 2.0 Basics 0 November 25th, 2007 06:25 PM
grid view komalpriya .NET Framework 2.0 3 November 7th, 2007 10:34 AM
grid view MunishBhatia ASP.NET 2.0 Professional 1 May 25th, 2007 07:26 AM
How to display data into Grid View? Somesh ASP.NET 2.0 Professional 5 May 25th, 2007 07:07 AM



All times are GMT -4. The time now is 04:40 PM.


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