Click here to Skip to main content
15,893,486 members
Home / Discussions / C#
   

C#

 
AnswerRe: Cant copy a complete text file Pin
kevinnicol23-Jul-10 7:07
kevinnicol23-Jul-10 7:07 
GeneralRe: Cant copy a complete text file Pin
ayandelhi23-Jul-10 7:23
ayandelhi23-Jul-10 7:23 
GeneralRe: Cant copy a complete text file Pin
ayandelhi23-Jul-10 7:25
ayandelhi23-Jul-10 7:25 
QuestionMessage Removed Pin
23-Jul-10 6:22
professionalN_tro_P23-Jul-10 6:22 
AnswerRe: Open With (my App) Pin
Samuel Cherinet23-Jul-10 6:34
Samuel Cherinet23-Jul-10 6:34 
AnswerRe: Open With (my App) Pin
Yusuf23-Jul-10 6:37
Yusuf23-Jul-10 6:37 
AnswerRe: Open With (my App) Pin
Luc Pattyn23-Jul-10 6:58
sitebuilderLuc Pattyn23-Jul-10 6:58 
Questionproblem displaying Pin
Dhyanga23-Jul-10 6:17
Dhyanga23-Jul-10 6:17 
I have a problem getting the right data from the database.
I have two tables named "Category" and "Items". Under one category, there can be multiple items.
table for category looks like:

catagory_ID | catagory_Name | catagory_Description



and the table for item looks like:

item_ID | cat_ID | item_Name | item_Description




Here category_ID and item_ID are unique keys and cat_ID is the foreign key which is the category_ID.
now i want the query which gives the list of data under typical category in the list format.
e.g if Book is the category Name and book_name1,book_name2,book_name3 are the items under category, it should look like

Book
    book_name1
    book_name2
    book_name3




how to do that? Well i can get something like this:

Book book_name1
Book book_name2
Book book_name3




but I want the category just once in the output..
I am using asp.net with c# and sql server..

code is:

<asp:Repeater runat="server" id="Repeater1">
    <HeaderTemplate>Categories<br /></HeaderTemplate>
    <ItemTemplate>
     <b><%# DataBinder.Eval(Container.DataItem, "category_Name") %></t></b>
     <br><%# DataBinder.Eval(Container.DataItem, "item_Name") %></br>
    </ItemTemplate>
</asp:Repeater>

suchita

AnswerRe: problem displaying Pin
PIEBALDconsult23-Jul-10 6:23
mvePIEBALDconsult23-Jul-10 6:23 
GeneralRe: problem displaying Pin
Dhyanga23-Jul-10 6:26
Dhyanga23-Jul-10 6:26 
GeneralRe: problem displaying Pin
PIEBALDconsult23-Jul-10 6:52
mvePIEBALDconsult23-Jul-10 6:52 
GeneralRe: problem displaying Pin
Dhyanga23-Jul-10 9:31
Dhyanga23-Jul-10 9:31 
GeneralRe: problem displaying Pin
PIEBALDconsult23-Jul-10 9:50
mvePIEBALDconsult23-Jul-10 9:50 
GeneralRe: problem displaying Pin
Dhyanga23-Jul-10 10:01
Dhyanga23-Jul-10 10:01 
GeneralRe: problem displaying Pin
riced24-Jul-10 0:14
riced24-Jul-10 0:14 
GeneralRe: problem displaying Pin
Dhyanga26-Jul-10 4:06
Dhyanga26-Jul-10 4:06 
Questionhow to call published web pages from windows services Pin
tomorrow_ft23-Jul-10 2:48
tomorrow_ft23-Jul-10 2:48 
AnswerRe: how to call published web pages from windows services Pin
Jason Vetter23-Jul-10 3:41
Jason Vetter23-Jul-10 3:41 
AnswerRe: how to call published web pages from windows services Pin
PIEBALDconsult23-Jul-10 5:11
mvePIEBALDconsult23-Jul-10 5:11 
QuestionOnline cources for beginners Pin
eiel23-Jul-10 2:05
eiel23-Jul-10 2:05 
AnswerRe: Online cources for beginners Pin
Peace ON23-Jul-10 4:22
Peace ON23-Jul-10 4:22 
AnswerRe: Online cources for beginners PinPopular
Sauro Viti23-Jul-10 4:28
professionalSauro Viti23-Jul-10 4:28 
AnswerRe: Online cources for beginners Pin
Luc Pattyn23-Jul-10 4:43
sitebuilderLuc Pattyn23-Jul-10 4:43 
GeneralRe: Online cources for beginners Pin
Nuri Ismail23-Jul-10 4:54
Nuri Ismail23-Jul-10 4:54 
AnswerRe: Online cources for beginners Pin
Ennis Ray Lynch, Jr.23-Jul-10 4:31
Ennis Ray Lynch, Jr.23-Jul-10 4:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.