p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
I forgot my password Register Now
Register | FAQ | Members List | Calendar | 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 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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 11th, 2007, 11:22 PM
Friend of Wrox
Points: 970, Level: 12
Points: 970, Level: 12 Points: 970, Level: 12 Points: 970, Level: 12
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 232
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......
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old November 12th, 2007, 01:49 AM
Friend of Wrox
Points: 970, Level: 12
Points: 970, Level: 12 Points: 970, Level: 12 Points: 970, Level: 12
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 232
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......
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old November 14th, 2007, 10:11 PM
Friend of Wrox
Points: 970, Level: 12
Points: 970, Level: 12 Points: 970, Level: 12 Points: 970, Level: 12
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 232
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......
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #6 (permalink)  
Old November 16th, 2007, 11:45 PM
Friend of Wrox
Points: 970, Level: 12
Points: 970, Level: 12 Points: 970, Level: 12 Points: 970, Level: 12
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 232
Thanks: 0
Thanked 1 Time in 1 Post
Default

yes, i solved it thanks for all help.

thanks......
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

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 02: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 08:26 AM
How to display data into Grid View? Somesh ASP.NET 2.0 Professional 5 May 25th, 2007 08:07 AM



All times are GMT -4. The time now is 07:10 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc