|
|
 |
| 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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

November 11th, 2007, 11:22 PM
|
|
Friend of Wrox
|
|
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 232
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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......
|

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
|
|
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
|

November 12th, 2007, 01:49 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 232
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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......
|

November 14th, 2007, 10:11 PM
|
|
Friend of Wrox
|
|
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 232
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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......
|

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
|
|
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
|

November 16th, 2007, 11:45 PM
|
|
Friend of Wrox
|
|
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 232
Thanks: 0
Thanked 1 Time in 1 Post
|
|
yes, i solved it thanks for all help.
thanks......
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |