Click here to Skip to main content
15,923,087 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a table like
bookid------book code -------book title-------ISBN-------AUTHOR
21-------zzzzzzzz-0001-------das--------------222--------das
22-------zzzzzzzz-0002-------das--------------222--------das
23-------java,api-0003-------Learn Java	------231--------Dietel
24-------java,api-0004-------Learn Java	------231--------Dietel
25-------java,api-0005-------Learn Java	------231--------Dietel
26-------corejava-0006-----Core Java Volume---222--------Ram 


there are several other fields too in this tables.
now i want to display data in a grid as folllows
Title.................Book Code........................ISBN....... Author...... Stock nos.
Learn Java..... java,api-0003,0004,0005.....................231.........Dietel..........3
das..................zzzzzzzz-0001,0002.....................222.........Ram.............2

any help or hint will be appreciated....

[edit]Code Blocks added, formatting tidied - OriginalGriff[/edit]
Posted
Updated 6-Jul-11 8:25am
v2

1 solution

Assuming you are databinding this, the columns will be displayed in the order you reference them in the SELECT statement, and you can provide better, more human friendly names than your table contains:
SELECT [book title] AS Title, [book code] AS [Book Code], ISBN, Author, StockLevel AS [Stock nos.] FROM myTable
Would probably give you the data you require.
 
Share this answer
 
Comments
sushil sainju 6-Jul-11 16:41pm    
not what i needed.... go thru question carefully befor u post solution.... neways thnx 4 tryin..
sushil sainju 6-Jul-11 16:43pm    
i need all book codes with same initial 8 characters but different last 4 numbers to appear in single row also i need to show total no.(count) of stock of books available.....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900